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/fileio.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/fileio.c')
| -rw-r--r-- | src/fileio.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/fileio.c b/src/fileio.c index dc6d80932c4..eeaa736290c 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -459,7 +459,8 @@ Given a Unix syntax file name, returns a string ending in slash. */) | |||
| 459 | strcat (res, "/"); | 459 | strcat (res, "/"); |
| 460 | beg = res; | 460 | beg = res; |
| 461 | p = beg + strlen (beg); | 461 | p = beg + strlen (beg); |
| 462 | dostounix_filename (beg, 0); | 462 | dostounix_filename (beg); |
| 463 | /* FIXME: Figure out the multibyte vs unibyte stuff here. */ | ||
| 463 | tem_fn = make_specified_string (beg, -1, p - beg, | 464 | tem_fn = make_specified_string (beg, -1, p - beg, |
| 464 | STRING_MULTIBYTE (filename)); | 465 | STRING_MULTIBYTE (filename)); |
| 465 | } | 466 | } |
| @@ -470,7 +471,7 @@ Given a Unix syntax file name, returns a string ending in slash. */) | |||
| 470 | else if (STRING_MULTIBYTE (filename)) | 471 | else if (STRING_MULTIBYTE (filename)) |
| 471 | { | 472 | { |
| 472 | tem_fn = make_specified_string (beg, -1, p - beg, 1); | 473 | tem_fn = make_specified_string (beg, -1, p - beg, 1); |
| 473 | dostounix_filename (SSDATA (tem_fn), 1); | 474 | dostounix_filename (SSDATA (tem_fn)); |
| 474 | #ifdef WINDOWSNT | 475 | #ifdef WINDOWSNT |
| 475 | if (!NILP (Vw32_downcase_file_names)) | 476 | if (!NILP (Vw32_downcase_file_names)) |
| 476 | tem_fn = Fdowncase (tem_fn); | 477 | tem_fn = Fdowncase (tem_fn); |
| @@ -478,7 +479,7 @@ Given a Unix syntax file name, returns a string ending in slash. */) | |||
| 478 | } | 479 | } |
| 479 | else | 480 | else |
| 480 | { | 481 | { |
| 481 | dostounix_filename (beg, 0); | 482 | dostounix_filename (beg); |
| 482 | tem_fn = make_specified_string (beg, -1, p - beg, 0); | 483 | tem_fn = make_specified_string (beg, -1, p - beg, 0); |
| 483 | } | 484 | } |
| 484 | return tem_fn; | 485 | return tem_fn; |
| @@ -582,7 +583,7 @@ file_name_as_directory (char *dst, const char *src, ptrdiff_t srclen, | |||
| 582 | dst[srclen++] = DIRECTORY_SEP; | 583 | dst[srclen++] = DIRECTORY_SEP; |
| 583 | dst[srclen] = 0; | 584 | dst[srclen] = 0; |
| 584 | #ifdef DOS_NT | 585 | #ifdef DOS_NT |
| 585 | dostounix_filename (dst, multibyte); | 586 | dostounix_filename (dst); |
| 586 | #endif | 587 | #endif |
| 587 | return srclen; | 588 | return srclen; |
| 588 | } | 589 | } |
| @@ -651,7 +652,7 @@ directory_file_name (char *dst, char *src, ptrdiff_t srclen, bool multibyte) | |||
| 651 | memcpy (dst, src, srclen); | 652 | memcpy (dst, src, srclen); |
| 652 | dst[srclen] = 0; | 653 | dst[srclen] = 0; |
| 653 | #ifdef DOS_NT | 654 | #ifdef DOS_NT |
| 654 | dostounix_filename (dst, multibyte); | 655 | dostounix_filename (dst); |
| 655 | #endif | 656 | #endif |
| 656 | return srclen; | 657 | return srclen; |
| 657 | } | 658 | } |
| @@ -1082,7 +1083,8 @@ filesystem tree, not (expand-file-name ".." dirname). */) | |||
| 1082 | #ifdef DOS_NT | 1083 | #ifdef DOS_NT |
| 1083 | /* Make sure directories are all separated with /, but | 1084 | /* Make sure directories are all separated with /, but |
| 1084 | avoid allocation of a new string when not required. */ | 1085 | avoid allocation of a new string when not required. */ |
| 1085 | dostounix_filename (nm, multibyte); | 1086 | /* FIXME: Figure out multibyte and downcase here. */ |
| 1087 | dostounix_filename (nm); | ||
| 1086 | #ifdef WINDOWSNT | 1088 | #ifdef WINDOWSNT |
| 1087 | if (IS_DIRECTORY_SEP (nm[1])) | 1089 | if (IS_DIRECTORY_SEP (nm[1])) |
| 1088 | { | 1090 | { |
| @@ -1465,7 +1467,8 @@ filesystem tree, not (expand-file-name ".." dirname). */) | |||
| 1465 | target[1] = ':'; | 1467 | target[1] = ':'; |
| 1466 | } | 1468 | } |
| 1467 | result = make_specified_string (target, -1, o - target, multibyte); | 1469 | result = make_specified_string (target, -1, o - target, multibyte); |
| 1468 | dostounix_filename (SSDATA (result), multibyte); | 1470 | /* FIXME: Figure out the multibyte and downcase here. */ |
| 1471 | dostounix_filename (SSDATA (result)); | ||
| 1469 | #ifdef WINDOWSNT | 1472 | #ifdef WINDOWSNT |
| 1470 | if (!NILP (Vw32_downcase_file_names)) | 1473 | if (!NILP (Vw32_downcase_file_names)) |
| 1471 | result = Fdowncase (result); | 1474 | result = Fdowncase (result); |
| @@ -1749,7 +1752,8 @@ those `/' is discarded. */) | |||
| 1749 | nm = xlispstrdupa (filename); | 1752 | nm = xlispstrdupa (filename); |
| 1750 | 1753 | ||
| 1751 | #ifdef DOS_NT | 1754 | #ifdef DOS_NT |
| 1752 | dostounix_filename (nm, multibyte); | 1755 | /* FIXME: Figure out multibyte and downcase. */ |
| 1756 | dostounix_filename (nm); | ||
| 1753 | substituted = (memcmp (nm, SDATA (filename), SBYTES (filename)) != 0); | 1757 | substituted = (memcmp (nm, SDATA (filename), SBYTES (filename)) != 0); |
| 1754 | #endif | 1758 | #endif |
| 1755 | endp = nm + SBYTES (filename); | 1759 | endp = nm + SBYTES (filename); |