diff options
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index 54335c5dd..44ec2eafd 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -7191,7 +7191,13 @@ subevalvar(char *start, char *str, int strloc, | |||
7191 | len = orig_len - pos; | 7191 | len = orig_len - pos; |
7192 | 7192 | ||
7193 | if (!quotes) { | 7193 | if (!quotes) { |
7194 | loc = mempcpy(startp, startp + pos, len); | 7194 | /* want: loc = mempcpy(startp, startp + pos, len) |
7195 | * but it does not allow overlapping arguments */ | ||
7196 | loc = startp; | ||
7197 | while (--len >= 0) { | ||
7198 | *loc = loc[pos]; | ||
7199 | loc++; | ||
7200 | } | ||
7195 | } else { | 7201 | } else { |
7196 | for (vstr = startp; pos != 0; pos--) { | 7202 | for (vstr = startp; pos != 0; pos--) { |
7197 | if ((unsigned char)*vstr == CTLESC) | 7203 | if ((unsigned char)*vstr == CTLESC) |