aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 15c7c325a..1917b552c 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12119,7 +12119,7 @@ parsesub: {
12119 STPUTC(c, out); 12119 STPUTC(c, out);
12120 c = pgetc_eatbnl(); 12120 c = pgetc_eatbnl();
12121 } while (isdigit(c)); 12121 } while (isdigit(c));
12122 } else if (is_special(c)) { 12122 } else {
12123 /* $[{[#]]<specialchar>[}] */ 12123 /* $[{[#]]<specialchar>[}] */
12124 int cc = c; 12124 int cc = c;
12125 12125
@@ -12137,10 +12137,16 @@ parsesub: {
12137 cc = '#'; 12137 cc = '#';
12138 } 12138 }
12139 } 12139 }
12140
12141 if (!is_special(cc)) {
12142 if (subtype == VSLENGTH)
12143 subtype = 0;
12144 goto badsub;
12145 }
12146
12140 USTPUTC(cc, out); 12147 USTPUTC(cc, out);
12141 } else {
12142 goto badsub;
12143 } 12148 }
12149
12144 if (c != '}' && subtype == VSLENGTH) { 12150 if (c != '}' && subtype == VSLENGTH) {
12145 /* ${#VAR didn't end with } */ 12151 /* ${#VAR didn't end with } */
12146 goto badsub; 12152 goto badsub;