Backslashes shouldn't be treated as backticks.
This commit is contained in:
parent
cbbe4d6bc2
commit
131241f71c
21
lash.c
21
lash.c
@ -1003,16 +1003,6 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
|
|||||||
returnCommand = *commandPtr + (src - *commandPtr) + 1;
|
returnCommand = *commandPtr + (src - *commandPtr) + 1;
|
||||||
break;
|
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
|
#ifdef BB_FEATURE_SH_BACKTICKS
|
||||||
case '`':
|
case '`':
|
||||||
/* Exec a backtick-ed command */
|
/* Exec a backtick-ed command */
|
||||||
@ -1082,6 +1072,17 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif // BB_FEATURE_SH_BACKTICKS
|
#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:
|
default:
|
||||||
*buf++ = *src;
|
*buf++ = *src;
|
||||||
}
|
}
|
||||||
|
21
sh.c
21
sh.c
@ -1003,16 +1003,6 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
|
|||||||
returnCommand = *commandPtr + (src - *commandPtr) + 1;
|
returnCommand = *commandPtr + (src - *commandPtr) + 1;
|
||||||
break;
|
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
|
#ifdef BB_FEATURE_SH_BACKTICKS
|
||||||
case '`':
|
case '`':
|
||||||
/* Exec a backtick-ed command */
|
/* Exec a backtick-ed command */
|
||||||
@ -1082,6 +1072,17 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif // BB_FEATURE_SH_BACKTICKS
|
#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:
|
default:
|
||||||
*buf++ = *src;
|
*buf++ = *src;
|
||||||
}
|
}
|
||||||
|
21
shell/lash.c
21
shell/lash.c
@ -1003,16 +1003,6 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
|
|||||||
returnCommand = *commandPtr + (src - *commandPtr) + 1;
|
returnCommand = *commandPtr + (src - *commandPtr) + 1;
|
||||||
break;
|
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
|
#ifdef BB_FEATURE_SH_BACKTICKS
|
||||||
case '`':
|
case '`':
|
||||||
/* Exec a backtick-ed command */
|
/* Exec a backtick-ed command */
|
||||||
@ -1082,6 +1072,17 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif // BB_FEATURE_SH_BACKTICKS
|
#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:
|
default:
|
||||||
*buf++ = *src;
|
*buf++ = *src;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user