diff options
author | Matt Kraai <kraai@debian.org> | 2000-09-14 00:43:20 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2000-09-14 00:43:20 +0000 |
commit | 131241f71cbb6e0dd997fc1f65a6a4f3c8b9d625 (patch) | |
tree | d49fe4c8a61744668a9b1cd571deffeef325c6f4 | |
parent | cbbe4d6bc2da9c370b813649ca7474641bbddbf2 (diff) | |
download | busybox-w32-131241f71cbb6e0dd997fc1f65a6a4f3c8b9d625.tar.gz busybox-w32-131241f71cbb6e0dd997fc1f65a6a4f3c8b9d625.tar.bz2 busybox-w32-131241f71cbb6e0dd997fc1f65a6a4f3c8b9d625.zip |
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 | |||
1003 | returnCommand = *commandPtr + (src - *commandPtr) + 1; | 1003 | returnCommand = *commandPtr + (src - *commandPtr) + 1; |
1004 | break; | 1004 | break; |
1005 | 1005 | ||
1006 | case '\\': | ||
1007 | src++; | ||
1008 | if (!*src) { | ||
1009 | errorMsg("character expected after \\\n"); | ||
1010 | freeJob(job); | ||
1011 | return 1; | ||
1012 | } | ||
1013 | if (*src == '*' || *src == '[' || *src == ']' | ||
1014 | || *src == '?') *buf++ = '\\'; | ||
1015 | /* fallthrough */ | ||
1016 | #ifdef BB_FEATURE_SH_BACKTICKS | 1006 | #ifdef BB_FEATURE_SH_BACKTICKS |
1017 | case '`': | 1007 | case '`': |
1018 | /* Exec a backtick-ed command */ | 1008 | /* Exec a backtick-ed command */ |
@@ -1082,6 +1072,17 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi | |||
1082 | } | 1072 | } |
1083 | break; | 1073 | break; |
1084 | #endif // BB_FEATURE_SH_BACKTICKS | 1074 | #endif // BB_FEATURE_SH_BACKTICKS |
1075 | |||
1076 | case '\\': | ||
1077 | src++; | ||
1078 | if (!*src) { | ||
1079 | errorMsg("character expected after \\\n"); | ||
1080 | freeJob(job); | ||
1081 | return 1; | ||
1082 | } | ||
1083 | if (*src == '*' || *src == '[' || *src == ']' | ||
1084 | || *src == '?') *buf++ = '\\'; | ||
1085 | /* fallthrough */ | ||
1085 | default: | 1086 | default: |
1086 | *buf++ = *src; | 1087 | *buf++ = *src; |
1087 | } | 1088 | } |
@@ -1003,16 +1003,6 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi | |||
1003 | returnCommand = *commandPtr + (src - *commandPtr) + 1; | 1003 | returnCommand = *commandPtr + (src - *commandPtr) + 1; |
1004 | break; | 1004 | break; |
1005 | 1005 | ||
1006 | case '\\': | ||
1007 | src++; | ||
1008 | if (!*src) { | ||
1009 | errorMsg("character expected after \\\n"); | ||
1010 | freeJob(job); | ||
1011 | return 1; | ||
1012 | } | ||
1013 | if (*src == '*' || *src == '[' || *src == ']' | ||
1014 | || *src == '?') *buf++ = '\\'; | ||
1015 | /* fallthrough */ | ||
1016 | #ifdef BB_FEATURE_SH_BACKTICKS | 1006 | #ifdef BB_FEATURE_SH_BACKTICKS |
1017 | case '`': | 1007 | case '`': |
1018 | /* Exec a backtick-ed command */ | 1008 | /* Exec a backtick-ed command */ |
@@ -1082,6 +1072,17 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi | |||
1082 | } | 1072 | } |
1083 | break; | 1073 | break; |
1084 | #endif // BB_FEATURE_SH_BACKTICKS | 1074 | #endif // BB_FEATURE_SH_BACKTICKS |
1075 | |||
1076 | case '\\': | ||
1077 | src++; | ||
1078 | if (!*src) { | ||
1079 | errorMsg("character expected after \\\n"); | ||
1080 | freeJob(job); | ||
1081 | return 1; | ||
1082 | } | ||
1083 | if (*src == '*' || *src == '[' || *src == ']' | ||
1084 | || *src == '?') *buf++ = '\\'; | ||
1085 | /* fallthrough */ | ||
1085 | default: | 1086 | default: |
1086 | *buf++ = *src; | 1087 | *buf++ = *src; |
1087 | } | 1088 | } |
diff --git a/shell/lash.c b/shell/lash.c index b4b11fb89..7bc43190d 100644 --- a/shell/lash.c +++ b/shell/lash.c | |||
@@ -1003,16 +1003,6 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi | |||
1003 | returnCommand = *commandPtr + (src - *commandPtr) + 1; | 1003 | returnCommand = *commandPtr + (src - *commandPtr) + 1; |
1004 | break; | 1004 | break; |
1005 | 1005 | ||
1006 | case '\\': | ||
1007 | src++; | ||
1008 | if (!*src) { | ||
1009 | errorMsg("character expected after \\\n"); | ||
1010 | freeJob(job); | ||
1011 | return 1; | ||
1012 | } | ||
1013 | if (*src == '*' || *src == '[' || *src == ']' | ||
1014 | || *src == '?') *buf++ = '\\'; | ||
1015 | /* fallthrough */ | ||
1016 | #ifdef BB_FEATURE_SH_BACKTICKS | 1006 | #ifdef BB_FEATURE_SH_BACKTICKS |
1017 | case '`': | 1007 | case '`': |
1018 | /* Exec a backtick-ed command */ | 1008 | /* Exec a backtick-ed command */ |
@@ -1082,6 +1072,17 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi | |||
1082 | } | 1072 | } |
1083 | break; | 1073 | break; |
1084 | #endif // BB_FEATURE_SH_BACKTICKS | 1074 | #endif // BB_FEATURE_SH_BACKTICKS |
1075 | |||
1076 | case '\\': | ||
1077 | src++; | ||
1078 | if (!*src) { | ||
1079 | errorMsg("character expected after \\\n"); | ||
1080 | freeJob(job); | ||
1081 | return 1; | ||
1082 | } | ||
1083 | if (*src == '*' || *src == '[' || *src == ']' | ||
1084 | || *src == '?') *buf++ = '\\'; | ||
1085 | /* fallthrough */ | ||
1085 | default: | 1086 | default: |
1086 | *buf++ = *src; | 1087 | *buf++ = *src; |
1087 | } | 1088 | } |