diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-01 23:24:48 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-07-01 23:26:12 +0200 |
commit | 48c803a2064d5ae24540760f13a21f092247bd82 (patch) | |
tree | 6683942a9c0461f02da7e90a0c4b0fde25746561 /shell/ash.c | |
parent | e9aba3e7ea4936278188555332654796e5b5e873 (diff) | |
download | busybox-w32-48c803a2064d5ae24540760f13a21f092247bd82.tar.gz busybox-w32-48c803a2064d5ae24540760f13a21f092247bd82.tar.bz2 busybox-w32-48c803a2064d5ae24540760f13a21f092247bd82.zip |
ash: fix $HOME/.profile reading if !ASH_EXPAND_PRMT, take 2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/shell/ash.c b/shell/ash.c index 22c726043..6d46e3719 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -2484,10 +2484,10 @@ setprompt_if(smallint do_set, int whichprompt) | |||
2484 | } | 2484 | } |
2485 | #if ENABLE_ASH_EXPAND_PRMT | 2485 | #if ENABLE_ASH_EXPAND_PRMT |
2486 | pushstackmark(&smark, stackblocksize()); | 2486 | pushstackmark(&smark, stackblocksize()); |
2487 | #endif | ||
2488 | putprompt(expandstr(prompt)); | 2487 | putprompt(expandstr(prompt)); |
2489 | #if ENABLE_ASH_EXPAND_PRMT | ||
2490 | popstackmark(&smark); | 2488 | popstackmark(&smark); |
2489 | #else | ||
2490 | putprompt(prompt); | ||
2491 | #endif | 2491 | #endif |
2492 | } | 2492 | } |
2493 | 2493 | ||
@@ -11534,9 +11534,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs) | |||
11534 | smallint dblquote; | 11534 | smallint dblquote; |
11535 | smallint oldstyle; | 11535 | smallint oldstyle; |
11536 | IF_FEATURE_SH_MATH(smallint prevsyntax;) /* syntax before arithmetic */ | 11536 | IF_FEATURE_SH_MATH(smallint prevsyntax;) /* syntax before arithmetic */ |
11537 | #if ENABLE_ASH_EXPAND_PRMT | ||
11538 | smallint pssyntax; /* we are expanding a prompt string */ | 11537 | smallint pssyntax; /* we are expanding a prompt string */ |
11539 | #endif | ||
11540 | int varnest; /* levels of variables expansion */ | 11538 | int varnest; /* levels of variables expansion */ |
11541 | IF_FEATURE_SH_MATH(int arinest;) /* levels of arithmetic expansion */ | 11539 | IF_FEATURE_SH_MATH(int arinest;) /* levels of arithmetic expansion */ |
11542 | IF_FEATURE_SH_MATH(int parenlevel;) /* levels of parens in arithmetic */ | 11540 | IF_FEATURE_SH_MATH(int parenlevel;) /* levels of parens in arithmetic */ |
@@ -11548,11 +11546,9 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs) | |||
11548 | bqlist = NULL; | 11546 | bqlist = NULL; |
11549 | quotef = 0; | 11547 | quotef = 0; |
11550 | IF_FEATURE_SH_MATH(prevsyntax = 0;) | 11548 | IF_FEATURE_SH_MATH(prevsyntax = 0;) |
11551 | #if ENABLE_ASH_EXPAND_PRMT | ||
11552 | pssyntax = (syntax == PSSYNTAX); | 11549 | pssyntax = (syntax == PSSYNTAX); |
11553 | if (pssyntax) | 11550 | if (pssyntax) |
11554 | syntax = DQSYNTAX; | 11551 | syntax = DQSYNTAX; |
11555 | #endif | ||
11556 | dblquote = (syntax == DQSYNTAX); | 11552 | dblquote = (syntax == DQSYNTAX); |
11557 | varnest = 0; | 11553 | varnest = 0; |
11558 | IF_FEATURE_SH_MATH(arinest = 0;) | 11554 | IF_FEATURE_SH_MATH(arinest = 0;) |
@@ -11606,12 +11602,10 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs) | |||
11606 | } else if (c == '\n') { | 11602 | } else if (c == '\n') { |
11607 | nlprompt(); | 11603 | nlprompt(); |
11608 | } else { | 11604 | } else { |
11609 | #if ENABLE_ASH_EXPAND_PRMT | ||
11610 | if (c == '$' && pssyntax) { | 11605 | if (c == '$' && pssyntax) { |
11611 | USTPUTC(CTLESC, out); | 11606 | USTPUTC(CTLESC, out); |
11612 | USTPUTC('\\', out); | 11607 | USTPUTC('\\', out); |
11613 | } | 11608 | } |
11614 | #endif | ||
11615 | /* Backslash is retained if we are in "str" and next char isn't special */ | 11609 | /* Backslash is retained if we are in "str" and next char isn't special */ |
11616 | if (dblquote | 11610 | if (dblquote |
11617 | && c != '\\' | 11611 | && c != '\\' |