mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
Fixes #170: An environment variable set by Sparkle
This commit is contained in:
1 parent
6b7752792d
commit
97c71ef700
1 file changed
+5
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user