diff --git a/SUPipedUnarchiver.m b/SUPipedUnarchiver.m index 5c82dbc8..08246647 100644 --- a/SUPipedUnarchiver.m +++ b/SUPipedUnarchiver.m @@ -67,6 +67,7 @@ fp = fopen([archivePath fileSystemRepresentation], "r"); if (!fp) goto reportError; + char *oldDestinationString = getenv("DESTINATION"); setenv("DESTINATION", [[archivePath stringByDeletingLastPathComponent] fileSystemRepresentation], 1); cmdFP = popen([command fileSystemRepresentation], "w"); size_t written; @@ -99,6 +100,10 @@ reportError: finally: if (fp) fclose(fp); + if (oldDestinationString) + setenv("DESTINATION", oldDestinationString, 1); + else + unsetenv("DESTINATION"); [pool release]; }