aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 39705a350..ef81ea70f 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12656,7 +12656,24 @@ expandstr(const char *ps, int syntax_type)
12656 12656
12657 saveprompt = doprompt; 12657 saveprompt = doprompt;
12658 doprompt = 0; 12658 doprompt = 0;
12659 readtoken1(pgetc(), syntax_type, FAKEEOFMARK, 0); 12659
12660 /* readtoken1() might die horribly.
12661 * Try a prompt with syntacticallyt wrong command:
12662 * PS1='$(date "+%H:%M:%S) > '
12663 */
12664 {
12665 volatile int saveint;
12666 struct jmploc *volatile savehandler = exception_handler;
12667 struct jmploc jmploc;
12668 SAVE_INT(saveint);
12669 if (setjmp(jmploc.loc) == 0) {
12670 exception_handler = &jmploc;
12671 readtoken1(pgetc(), syntax_type, FAKEEOFMARK, 0);
12672 }
12673 exception_handler = savehandler;
12674 RESTORE_INT(saveint);
12675 }
12676
12660 doprompt = saveprompt; 12677 doprompt = saveprompt;
12661 12678
12662 popfile(); 12679 popfile();