merge from open-source master

Change-Id: I8b1e7e238d9d0e828bea72530b5356b8386e48bc
This commit is contained in:
The Android Open Source Project 2010-06-04 08:00:52 -07:00
commit 6be163b167
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));
}
/*