diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2010-06-04 08:00:52 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2010-06-04 08:00:52 -0700 |
commit | 6be163b167e986b4fafda9290e5d74fc3945b273 (patch) | |
tree | d4d47b3a2ddacfb9da4dd026ceb23dd617abb13d /sh | |
parent | 324a98f1901fb84ec4c88196e01c3e14c2b5a4a4 (diff) | |
parent | ad5431d2ca9c4dd454dfb3bc8e9de3ee0ad28a27 (diff) | |
download | system_core-6be163b167e986b4fafda9290e5d74fc3945b273.zip system_core-6be163b167e986b4fafda9290e5d74fc3945b273.tar.gz system_core-6be163b167e986b4fafda9290e5d74fc3945b273.tar.bz2 |
merge from open-source master
Change-Id: I8b1e7e238d9d0e828bea72530b5356b8386e48bc
Diffstat (limited to 'sh')
-rw-r--r-- | sh/input.c | 3 | ||||
-rw-r--r-- | sh/input.h | 1 | ||||
-rw-r--r-- | sh/parser.c | 4 |
3 files changed, 6 insertions, 2 deletions
@@ -175,6 +175,9 @@ pgetc(void) return pgetc_macro(); } +int in_interactive_mode() { + return parsefile != NULL && parsefile->fd == 0; +} static int preadfd(void) @@ -46,6 +46,7 @@ extern int parsenleft; /* number of characters left in input buffer */ extern char *parsenextc; /* next character in input buffer */ extern int init_editline; /* 0 == not setup, 1 == OK, -1 == failed */ +int in_interactive_mode(); char *pfgets(char *, int); int pgetc(void); int preadbuffer(void); diff --git a/sh/parser.c b/sh/parser.c index d956375..faf0268 100644 --- a/sh/parser.c +++ b/sh/parser.c @@ -1629,9 +1629,9 @@ setprompt(int which) if (!el) #endif #ifdef WITH_LINENOISE -#else - out2str(getprompt(NULL)); + if (! in_interactive_mode() ) #endif + out2str(getprompt(NULL)); } /* |