am 6be163b1: merge from open-source master

Merge commit '6be163b167e986b4fafda9290e5d74fc3945b273' into kraken

* commit '6be163b167e986b4fafda9290e5d74fc3945b273':
  Emit shell prompt even when in non-interactive mode.
This commit is contained in:
The Android Open Source Project 2010-06-04 08:16:25 -07:00 committed by Android Git Automerger
commit c491fdc6f5
3 changed files with 6 additions and 2 deletions

View File

@ -175,6 +175,9 @@ pgetc(void)
return pgetc_macro();
}
int in_interactive_mode() {
return parsefile != NULL && parsefile->fd == 0;
}
static int
preadfd(void)

View File

@ -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);

View File

@ -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));
}
/*