diff options
author | Matt Kraai | 2000-09-14 00:43:20 +0000 |
---|---|---|
committer | Matt Kraai | 2000-09-14 00:43:20 +0000 |
commit | 131241f71cbb6e0dd997fc1f65a6a4f3c8b9d625 (patch) | |
tree | d49fe4c8a61744668a9b1cd571deffeef325c6f4 | |
parent | cbbe4d6bc2da9c370b813649ca7474641bbddbf2 (diff) | |
download | busybox-131241f71cbb6e0dd997fc1f65a6a4f3c8b9d625.zip busybox-131241f71cbb6e0dd997fc1f65a6a4f3c8b9d625.tar.gz |
Backslashes shouldn't be treated as backticks.
-rw-r--r-- | lash.c | 21 | ||||
-rw-r--r-- | sh.c | 21 | ||||
-rw-r--r-- | shell/lash.c | 21 |
3 files changed, 33 insertions, 30 deletions
@@ -1003,16 +1003,6 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi returnCommand = *commandPtr + (src - *commandPtr) + 1; break; - case '\\': - src++; - if (!*src) { - errorMsg("character expected after \\\n"); - freeJob(job); - return 1; - } - if (*src == '*' || *src == '[' || *src == ']' - || *src == '?') *buf++ = '\\'; - /* fallthrough */ #ifdef BB_FEATURE_SH_BACKTICKS case '`': /* Exec a backtick-ed command */ @@ -1082,6 +1072,17 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi } break; #endif // BB_FEATURE_SH_BACKTICKS + + case '\\': + src++; + if (!*src) { + errorMsg("character expected after \\\n"); + freeJob(job); + return 1; + } + if (*src == '*' || *src == '[' || *src == ']' + || *src == '?') *buf++ = '\\'; + /* fallthrough */ default: *buf++ = *src; } @@ -1003,16 +1003,6 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi returnCommand = *commandPtr + (src - *commandPtr) + 1; break; - case '\\': - src++; - if (!*src) { - errorMsg("character expected after \\\n"); - freeJob(job); - return 1; - } - if (*src == '*' || *src == '[' || *src == ']' - || *src == '?') *buf++ = '\\'; - /* fallthrough */ #ifdef BB_FEATURE_SH_BACKTICKS case '`': /* Exec a backtick-ed command */ @@ -1082,6 +1072,17 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi } break; #endif // BB_FEATURE_SH_BACKTICKS + + case '\\': + src++; + if (!*src) { + errorMsg("character expected after \\\n"); + freeJob(job); + return 1; + } + if (*src == '*' || *src == '[' || *src == ']' + || *src == '?') *buf++ = '\\'; + /* fallthrough */ default: *buf++ = *src; } diff --git a/shell/lash.c b/shell/lash.c index b4b11fb..7bc4319 100644 --- a/shell/lash.c +++ b/shell/lash.c @@ -1003,16 +1003,6 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi returnCommand = *commandPtr + (src - *commandPtr) + 1; break; - case '\\': - src++; - if (!*src) { - errorMsg("character expected after \\\n"); - freeJob(job); - return 1; - } - if (*src == '*' || *src == '[' || *src == ']' - || *src == '?') *buf++ = '\\'; - /* fallthrough */ #ifdef BB_FEATURE_SH_BACKTICKS case '`': /* Exec a backtick-ed command */ @@ -1082,6 +1072,17 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi } break; #endif // BB_FEATURE_SH_BACKTICKS + + case '\\': + src++; + if (!*src) { + errorMsg("character expected after \\\n"); + freeJob(job); + return 1; + } + if (*src == '*' || *src == '[' || *src == ']' + || *src == '?') *buf++ = '\\'; + /* fallthrough */ default: *buf++ = *src; } |