Backslashes shouldn't be treated as backticks.
authorMatt Kraai <kraai@debian.org>
Thu, 14 Sep 2000 00:43:20 +0000 (00:43 -0000)
committerMatt Kraai <kraai@debian.org>
Thu, 14 Sep 2000 00:43:20 +0000 (00:43 -0000)
lash.c
sh.c
shell/lash.c

diff --git a/lash.c b/lash.c
index b4b11fb8923d355fda9b6bbcb330547f7c5e7f65..7bc43190db55a43bc4a8a520b8b77bf94ca9bff2 100644 (file)
--- a/lash.c
+++ b/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;
                        }
diff --git a/sh.c b/sh.c
index b4b11fb8923d355fda9b6bbcb330547f7c5e7f65..7bc43190db55a43bc4a8a520b8b77bf94ca9bff2 100644 (file)
--- a/sh.c
+++ b/sh.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;
                        }
index b4b11fb8923d355fda9b6bbcb330547f7c5e7f65..7bc43190db55a43bc4a8a520b8b77bf94ca9bff2 100644 (file)
@@ -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;
                        }