Oops, I guess it was needed after all.
This commit is contained in:
parent
a6096af13e
commit
1ae460a02b
7
bb.c
7
bb.c
@ -1278,14 +1278,15 @@ int main(int argc, char *argv[])
|
||||
write(cmdfd, "\0", 1);
|
||||
for (int i = 0; i < argc; i++) {
|
||||
if (argv[i][0] == '+') {
|
||||
char *colon = strchr(argv[i], ':');
|
||||
char *cmd = argv[i];
|
||||
char *colon = strchr(cmd, ':');
|
||||
if (colon && !colon[1]) {
|
||||
for (++i; i < argc; i++) {
|
||||
write(cmdfd, argv[i], strlen(argv[i]));
|
||||
write(cmdfd, cmd, strlen(cmd));
|
||||
write(cmdfd, argv[i], strlen(argv[i])+1); // Include null byte
|
||||
}
|
||||
} else {
|
||||
write(cmdfd, argv[i], strlen(argv[i])+1); // Include null byte
|
||||
write(cmdfd, cmd, strlen(cmd)+1); // Include null byte
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user