diff --git a/mflag.c b/mflag.c index 1c6dace..73941d2 100644 --- a/mflag.c +++ b/mflag.c @@ -26,16 +26,18 @@ char *curfile; void add(char *file) { - if (idx >= argsalloc) { - argsalloc *= 2; - if (argsalloc < 0) - exit(-1); - args = realloc(args, sizeof (char *) * argsalloc); - } - if (!args) - exit(-1); - args[idx] = strdup(file); - idx++; + if (idx >= argsalloc) { + argsalloc *= 2; + if (argsalloc < 0) + exit(-1); + args = realloc(args, sizeof (char *) * argsalloc); + } + if (!args) + exit(-1); + while (*file == ' ' || *file == '\t') + file++; + args[idx] = strdup(file); + idx++; } void