Commits

Peter Hosey committed f787e15

Actually use the current directory if it's set. Oops.

  • Participants
  • Parent commits 83e7c05

Comments (0)

Files changed (1)

 		setenv([key UTF8String], [value UTF8String], /*overwrite*/ 1);
 	}
 
+	NSString *desiredCWD = self.currentDirectoryPath;
+	if (desiredCWD) {
+		int changed = chdir([desiredCWD fileSystemRepresentation]);
+		NSAssert(changed == 0, @"Could not change CWD to %@", desiredCWD);
+	}
+
 	char **argv = malloc(sizeof(char *) * ([args count] + 1));
 	char **argvp = argv;