]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport of 1.2:
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 3 Jun 2004 14:16:53 +0000 (14:16 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 3 Jun 2004 14:16:53 +0000 (14:16 +0000)
On startup, attempt to set the working directory to $HOME.

Fixes #913581.

Mac/OSX/PythonLauncher/main.m

index 70323f2d02de5deeed387d4f5c9366c6588be78e..6841433f429f3fa21d7f126ccb64567cb63f5079 100755 (executable)
@@ -7,8 +7,11 @@
 //
 
 #import <Cocoa/Cocoa.h>
+#include <unistd.h>
 
 int main(int argc, const char *argv[])
 {
+       char *home = getenv("HOME");
+       if (home) chdir(home);
     return NSApplicationMain(argc, argv);
 }