+Sat Apr 21 18:00:31 CDT 2001 Adam Heath <doogie@debian.org>
+
+ * main/main.c: reworked \\ parsing in commandfd.
+
Sun Apr 22 00:48:18 CEST 2001 Wichert Akkerman <wakkerma@debian.org>
* main/main.c: fixed some bizar pointer usage
const char **newargs;
char *ptr, *endptr;
FILE *in;
- int c, lno, infd, i;
+ int c, lno, infd, i, skipchar;
static void (*actionfunction)(const char *const *argv);
if ((pipein= *argv++) == NULL) badusage(_("--command-fd takes 1 argument, not 0"));
argc= 1;
ptr= linevb.buf;
endptr= ptr + linevb.used;
+ skipchar= 0;
while(ptr < endptr) {
- if (*ptr == '\\') {
+ if (skipchar) {
+ skipchar= 0;
+ } else if (*ptr == '\\') {
memmove(ptr, (ptr+1), (linevb.used-(linevb.buf - ptr)-1));
+ endptr--;
+ skipchar= 1;
continue;
} else if (isspace(*ptr)) {
if (mode == 1) {