about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--mflag.c22
1 files changed, 12 insertions, 10 deletions
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