summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko2017-07-01 23:24:48 +0200
committerDenys Vlasenko2017-07-01 23:26:12 +0200
commit48c803a2064d5ae24540760f13a21f092247bd82 (patch)
tree6683942a9c0461f02da7e90a0c4b0fde25746561 /shell
parente9aba3e7ea4936278188555332654796e5b5e873 (diff)
downloadbusybox-48c803a2064d5ae24540760f13a21f092247bd82.zip
busybox-48c803a2064d5ae24540760f13a21f092247bd82.tar.gz
ash: fix $HOME/.profile reading if !ASH_EXPAND_PRMT, take 2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 22c7260..6d46e37 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -2484,10 +2484,10 @@ setprompt_if(smallint do_set, int whichprompt)
}
#if ENABLE_ASH_EXPAND_PRMT
pushstackmark(&smark, stackblocksize());
-#endif
putprompt(expandstr(prompt));
-#if ENABLE_ASH_EXPAND_PRMT
popstackmark(&smark);
+#else
+ putprompt(prompt);
#endif
}
@@ -11534,9 +11534,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
smallint dblquote;
smallint oldstyle;
IF_FEATURE_SH_MATH(smallint prevsyntax;) /* syntax before arithmetic */
-#if ENABLE_ASH_EXPAND_PRMT
smallint pssyntax; /* we are expanding a prompt string */
-#endif
int varnest; /* levels of variables expansion */
IF_FEATURE_SH_MATH(int arinest;) /* levels of arithmetic expansion */
IF_FEATURE_SH_MATH(int parenlevel;) /* levels of parens in arithmetic */
@@ -11548,11 +11546,9 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
bqlist = NULL;
quotef = 0;
IF_FEATURE_SH_MATH(prevsyntax = 0;)
-#if ENABLE_ASH_EXPAND_PRMT
pssyntax = (syntax == PSSYNTAX);
if (pssyntax)
syntax = DQSYNTAX;
-#endif
dblquote = (syntax == DQSYNTAX);
varnest = 0;
IF_FEATURE_SH_MATH(arinest = 0;)
@@ -11606,12 +11602,10 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
} else if (c == '\n') {
nlprompt();
} else {
-#if ENABLE_ASH_EXPAND_PRMT
if (c == '$' && pssyntax) {
USTPUTC(CTLESC, out);
USTPUTC('\\', out);
}
-#endif
/* Backslash is retained if we are in "str" and next char isn't special */
if (dblquote
&& c != '\\'