diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32.c | 8 |
1 files changed, 6 insertions, 2 deletions
| @@ -639,7 +639,7 @@ char *get_emacs_configuration (void); | |||
| 639 | extern Lisp_Object Vsystem_configuration; | 639 | extern Lisp_Object Vsystem_configuration; |
| 640 | 640 | ||
| 641 | void | 641 | void |
| 642 | init_environment () | 642 | init_environment (char ** argv) |
| 643 | { | 643 | { |
| 644 | int len; | 644 | int len; |
| 645 | static const char * const tempdirs[] = { | 645 | static const char * const tempdirs[] = { |
| @@ -758,7 +758,7 @@ init_environment () | |||
| 758 | 758 | ||
| 759 | { | 759 | { |
| 760 | char *p; | 760 | char *p; |
| 761 | char modname[MAX_PATH]; | 761 | static char modname[MAX_PATH]; |
| 762 | 762 | ||
| 763 | if (!GetModuleFileName (NULL, modname, MAX_PATH)) | 763 | if (!GetModuleFileName (NULL, modname, MAX_PATH)) |
| 764 | abort (); | 764 | abort (); |
| @@ -767,6 +767,10 @@ init_environment () | |||
| 767 | *p = 0; | 767 | *p = 0; |
| 768 | 768 | ||
| 769 | SetCurrentDirectory (modname); | 769 | SetCurrentDirectory (modname); |
| 770 | |||
| 771 | /* Ensure argv[0] has the full path to Emacs. */ | ||
| 772 | *p = '\\'; | ||
| 773 | argv[0] = modname; | ||
| 770 | } | 774 | } |
| 771 | 775 | ||
| 772 | init_user_info (); | 776 | init_user_info (); |