diff options
| author | Eli Zaretskii | 2013-11-02 15:03:32 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2013-11-02 15:03:32 +0200 |
| commit | 1fd201bb1d720d0c5ab727a3972363778eef834f (patch) | |
| tree | 508abf22dbb91d24309869bc42a93e814f9fbcd6 /src/w32proc.c | |
| parent | 5c4a19a90f803ed46629c2bdc1ac3d3563caa738 (diff) | |
| download | emacs-1fd201bb1d720d0c5ab727a3972363778eef834f.tar.gz emacs-1fd201bb1d720d0c5ab727a3972363778eef834f.zip | |
Adapted dostounix_filename. w32-short/long-filename work with wide APIs.
Diffstat (limited to 'src/w32proc.c')
| -rw-r--r-- | src/w32proc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/w32proc.c b/src/w32proc.c index ea16f26a0ee..89748267bc6 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -2647,10 +2647,11 @@ All path elements in FILENAME are converted to their short names. */) | |||
| 2647 | filename = Fexpand_file_name (filename, Qnil); | 2647 | filename = Fexpand_file_name (filename, Qnil); |
| 2648 | 2648 | ||
| 2649 | /* luckily, this returns the short version of each element in the path. */ | 2649 | /* luckily, this returns the short version of each element in the path. */ |
| 2650 | if (GetShortPathName (SDATA (ENCODE_FILE (filename)), shortname, MAX_PATH) == 0) | 2650 | if (w32_get_short_filename (SDATA (ENCODE_FILE (filename)), |
| 2651 | shortname, MAX_PATH) == 0) | ||
| 2651 | return Qnil; | 2652 | return Qnil; |
| 2652 | 2653 | ||
| 2653 | dostounix_filename (shortname, 0); | 2654 | dostounix_filename (shortname); |
| 2654 | 2655 | ||
| 2655 | /* No need to DECODE_FILE, because 8.3 names are pure ASCII. */ | 2656 | /* No need to DECODE_FILE, because 8.3 names are pure ASCII. */ |
| 2656 | return build_string (shortname); | 2657 | return build_string (shortname); |
| @@ -2664,7 +2665,7 @@ If FILENAME does not exist, return nil. | |||
| 2664 | All path elements in FILENAME are converted to their long names. */) | 2665 | All path elements in FILENAME are converted to their long names. */) |
| 2665 | (Lisp_Object filename) | 2666 | (Lisp_Object filename) |
| 2666 | { | 2667 | { |
| 2667 | char longname[ MAX_PATH ]; | 2668 | char longname[ MAX_UTF8_PATH ]; |
| 2668 | int drive_only = 0; | 2669 | int drive_only = 0; |
| 2669 | 2670 | ||
| 2670 | CHECK_STRING (filename); | 2671 | CHECK_STRING (filename); |
| @@ -2676,10 +2677,11 @@ All path elements in FILENAME are converted to their long names. */) | |||
| 2676 | /* first expand it. */ | 2677 | /* first expand it. */ |
| 2677 | filename = Fexpand_file_name (filename, Qnil); | 2678 | filename = Fexpand_file_name (filename, Qnil); |
| 2678 | 2679 | ||
| 2679 | if (!w32_get_long_filename (SDATA (ENCODE_FILE (filename)), longname, MAX_PATH)) | 2680 | if (!w32_get_long_filename (SDATA (ENCODE_FILE (filename)), longname, |
| 2681 | MAX_UTF8_PATH)) | ||
| 2680 | return Qnil; | 2682 | return Qnil; |
| 2681 | 2683 | ||
| 2682 | dostounix_filename (longname, 0); | 2684 | dostounix_filename (longname); |
| 2683 | 2685 | ||
| 2684 | /* If we were passed only a drive, make sure that a slash is not appended | 2686 | /* If we were passed only a drive, make sure that a slash is not appended |
| 2685 | for consistency with directories. Allow for drive mapping via SUBST | 2687 | for consistency with directories. Allow for drive mapping via SUBST |
| @@ -2687,7 +2689,7 @@ All path elements in FILENAME are converted to their long names. */) | |||
| 2687 | if (drive_only && longname[1] == ':' && longname[2] == '/' && !longname[3]) | 2689 | if (drive_only && longname[1] == ':' && longname[2] == '/' && !longname[3]) |
| 2688 | longname[2] = '\0'; | 2690 | longname[2] = '\0'; |
| 2689 | 2691 | ||
| 2690 | return DECODE_FILE (build_string (longname)); | 2692 | return DECODE_FILE (build_unibyte_string (longname)); |
| 2691 | } | 2693 | } |
| 2692 | 2694 | ||
| 2693 | DEFUN ("w32-set-process-priority", Fw32_set_process_priority, | 2695 | DEFUN ("w32-set-process-priority", Fw32_set_process_priority, |