bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

interactive mode should test stderr not stdout for isatty()


From: llattanzi+bash
Subject: interactive mode should test stderr not stdout for isatty()
Date: Mon, 21 Jun 2004 22:47:54 -0700 (PDT)

Configuration Information [Automatically generated, do not change]:
Machine: powerpc
OS: darwin8.0
Compiler: gcc
Compilation CFLAGS: -arch i386 -arch ppc -g -Os -pipe -no-cpp-precomp -arch i386 -arch ppc -pipe -DPROGRAM='bash' -DCONF_HOSTTYPE='powerpc' -DCONF_OSTYPE='darwin8.0' -DCONF_MACHTYPE='powerpc-apple-darwin8.0' -DCONF_VENDOR='apple' -DSHELL -DHAVE_CONFIG_H -DMACOSX -I. -I/SourceCache/bash/bash-30/bash -I/SourceCache/bash/bash-30/bash/include -I/SourceCache/bash/bash-30/bash/lib -arch i386 -arch ppc -g -Os -pipe -no-cpp-precomp -arch i386 -arch ppc -pipe uname output: Darwin stderr.apple.com 8.0.0b1 Darwin Kernel Version 8.0.0b1: Mon May 10 23:45:14 PDT 2004; root:xnu/xnu-600.3.obj~4/RELEASE_PPC Power Macintosh powerpc
Machine Type: powerpc-apple-darwin8.0

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:
        sh > sh.out #should be an interactive session

Repeat-By:
        sh > sh.out
        <try an interactive editting command>

Fix:
Index: bash/shell.c
===================================================================
RCS file: /cvs/root/bash/bash/shell.c,v
retrieving revision 1.3
diff -u -d -b -w -r1.3 shell.c
--- shell.c     2003/04/05 08:10:15     1.3
+++ shell.c     2004/06/22 05:32:19
@@ -465,7 +465,7 @@
        no -c command
        no arguments remaining or the -s flag given
        standard input is a terminal
-       standard output is a terminal
+       standard error is a terminal
      Refer to Posix.2, the description of the `sh' utility. */

   if (forced_interactive ||            /* -i flag */
@@ -474,7 +474,7 @@
        ((arg_index == argc) ||         /*   no remaining args or... */
        read_from_stdin) &&             /*   -s flag with args, and */
        isatty (fileno (stdin)) &&      /* Input is a terminal and */
-       isatty (fileno (stdout))))      /* output is a terminal. */
+       isatty (fileno (stderr))))      /* stderr is a terminal. */
     init_interactive ();
   else
     init_noninteractive ();
Index: bash/doc/bash.1
===================================================================
RCS file: /cvs/root/bash/bash/doc/bash.1,v
retrieving revision 1.1.1.5
diff -u -d -b -w -r1.1.1.5 bash.1
--- bash.1      2003/04/05 08:00:29     1.1.1.5
+++ bash.1      2004/06/22 05:32:19
@@ -258,7 +258,7 @@
 and without the
 .B \-c
 option
-whose standard input and output are
+whose standard input and error are
 both connected to terminals (as determined by
 .IR isatty (3)),
 or one started with the





reply via email to

[Prev in Thread] Current Thread [Next in Thread]