diff options
| author | Eli Zaretskii | 2013-12-07 16:45:31 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-12-07 16:45:31 +0200 |
| commit | 080fd64974060e6b47573c94af2b80f1a5f3ef2c (patch) | |
| tree | 16e92fcf37207dfd19d1ae14e57b0bde2121f3a5 /src/emacs.c | |
| parent | 94ae1542354539a0660b21cf3b7a5143139b8375 (diff) | |
| download | emacs-080fd64974060e6b47573c94af2b80f1a5f3ef2c.tar.gz emacs-080fd64974060e6b47573c94af2b80f1a5f3ef2c.zip | |
Fixed initialization code and default-printer-name.
Diffstat (limited to 'src/emacs.c')
| -rw-r--r-- | src/emacs.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/emacs.c b/src/emacs.c index 9f41bc251ea..22be1d82949 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -394,7 +394,20 @@ init_cmdargs (int argc, char **argv, int skip_args, char *original_pwd) | |||
| 394 | initial_argv = argv; | 394 | initial_argv = argv; |
| 395 | initial_argc = argc; | 395 | initial_argc = argc; |
| 396 | 396 | ||
| 397 | #ifdef WINDOWSNT | ||
| 398 | /* Must use argv[0] converted to UTF-8, as it begets many standard | ||
| 399 | file and directory names. */ | ||
| 400 | { | ||
| 401 | char argv0[MAX_UTF8_PATH]; | ||
| 402 | |||
| 403 | if (filename_from_ansi (argv[0], argv0) == 0) | ||
| 404 | raw_name = build_unibyte_string (argv0); | ||
| 405 | else | ||
| 406 | raw_name = build_unibyte_string (argv[0]); | ||
| 407 | } | ||
| 408 | #else | ||
| 397 | raw_name = build_unibyte_string (argv[0]); | 409 | raw_name = build_unibyte_string (argv[0]); |
| 410 | #endif | ||
| 398 | 411 | ||
| 399 | /* Add /: to the front of the name | 412 | /* Add /: to the front of the name |
| 400 | if it would otherwise be treated as magic. */ | 413 | if it would otherwise be treated as magic. */ |
| @@ -796,6 +809,14 @@ main (int argc, char **argv) | |||
| 796 | 809 | ||
| 797 | if (argmatch (argv, argc, "-chdir", "--chdir", 4, &ch_to_dir, &skip_args)) | 810 | if (argmatch (argv, argc, "-chdir", "--chdir", 4, &ch_to_dir, &skip_args)) |
| 798 | { | 811 | { |
| 812 | #ifdef WINDOWSNT | ||
| 813 | /* argv[] array is kept in its original ANSI codepage encoding, | ||
| 814 | we need to convert to UTF-8, for chdir to work. */ | ||
| 815 | char newdir[MAX_UTF8_PATH]; | ||
| 816 | |||
| 817 | filename_from_ansi (ch_to_dir, newdir); | ||
| 818 | ch_to_dir = newdir; | ||
| 819 | #endif | ||
| 799 | original_pwd = get_current_dir_name (); | 820 | original_pwd = get_current_dir_name (); |
| 800 | if (chdir (ch_to_dir) != 0) | 821 | if (chdir (ch_to_dir) != 0) |
| 801 | { | 822 | { |
| @@ -1531,7 +1552,16 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem | |||
| 1531 | char *file; | 1552 | char *file; |
| 1532 | /* Handle -l loadup, args passed by Makefile. */ | 1553 | /* Handle -l loadup, args passed by Makefile. */ |
| 1533 | if (argmatch (argv, argc, "-l", "--load", 3, &file, &skip_args)) | 1554 | if (argmatch (argv, argc, "-l", "--load", 3, &file, &skip_args)) |
| 1534 | Vtop_level = list2 (intern_c_string ("load"), build_string (file)); | 1555 | { |
| 1556 | #ifdef WINDOWSNT | ||
| 1557 | char file_utf8[MAX_UTF8_PATH]; | ||
| 1558 | |||
| 1559 | if (filename_from_ansi (file, file_utf8) == 0) | ||
| 1560 | file = file_utf8; | ||
| 1561 | #endif | ||
| 1562 | Vtop_level = list2 (intern_c_string ("load"), | ||
| 1563 | build_unibyte_string (file)); | ||
| 1564 | } | ||
| 1535 | /* Unless next switch is -nl, load "loadup.el" first thing. */ | 1565 | /* Unless next switch is -nl, load "loadup.el" first thing. */ |
| 1536 | if (! no_loadup) | 1566 | if (! no_loadup) |
| 1537 | Vtop_level = list2 (intern_c_string ("load"), | 1567 | Vtop_level = list2 (intern_c_string ("load"), |