Commits

Peter Hosey committed 35cd701

Fixed taskWithProgramName:arguments:, which had been omitting the name (oops) and first argument (double oops) and potentially going off the end of the argument list (triple oops).

Comments (0)

Files changed (1)

 	va_list argl;
 	va_start(argl, arg1);
 
-	NSMutableArray *array = [NSMutableArray array];
-	id arg = nil;
-	while ((arg = va_arg(argl, id))) {
-		[array addObject:arg];
+	NSMutableArray *array = [NSMutableArray arrayWithObject:name];
+	if (arg1) {
+		[array addObject:arg1];
+
+		id arg = nil;
+		while ((arg = va_arg(argl, id))) {
+			[array addObject:arg];
+		}
 	}
 
 	va_end(argl);