diff options
| author | Stefan Monnier | 2022-07-10 11:15:27 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2022-07-10 11:15:27 -0400 |
| commit | d51d72b4a62384f33a593f5a2c0922c1aaecf106 (patch) | |
| tree | cbd7c2d486a5a5eee5c08937a11eac917fdc17c0 /src | |
| parent | 46a2e5dc93ccbb36309f859460cb527c91adc4d1 (diff) | |
| download | emacs-d51d72b4a62384f33a593f5a2c0922c1aaecf106.tar.gz emacs-d51d72b4a62384f33a593f5a2c0922c1aaecf106.zip | |
* src/dired.c (directory_files_internal): Update comment
Diffstat (limited to 'src')
| -rw-r--r-- | src/dired.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/dired.c b/src/dired.c index 9aeff516369..c2c099f0a5f 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -270,7 +270,17 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, | |||
| 270 | ptrdiff_t name_nbytes = SBYTES (name); | 270 | ptrdiff_t name_nbytes = SBYTES (name); |
| 271 | ptrdiff_t nbytes = directory_nbytes + needsep + name_nbytes; | 271 | ptrdiff_t nbytes = directory_nbytes + needsep + name_nbytes; |
| 272 | ptrdiff_t nchars = SCHARS (directory) + needsep + SCHARS (name); | 272 | ptrdiff_t nchars = SCHARS (directory) + needsep + SCHARS (name); |
| 273 | /* FIXME: Why not make them all multibyte? */ | 273 | /* DECODE_FILE may return non-ASCII unibyte strings (e.g. when |
| 274 | file-name-coding-system is 'binary'), so we don't know for sure | ||
| 275 | that the bytes we have follow our internal utf-8 representation | ||
| 276 | for multibyte strings. If nchars == nbytes we don't need to | ||
| 277 | care and just return a unibyte string; and if not, that means | ||
| 278 | one of 'name' or 'directory' is multibyte, in which case we | ||
| 279 | presume that the other one would also be multibyte if it | ||
| 280 | contained non-ASCII. | ||
| 281 | FIXME: This last presumption is broken when 'directory' is | ||
| 282 | multibyte (with non-ASCII), and 'name' is unibyte with non-ASCII | ||
| 283 | (because file-name-coding-system is 'binary'). */ | ||
| 274 | finalname = (nchars == nbytes) | 284 | finalname = (nchars == nbytes) |
| 275 | ? make_uninit_string (nbytes) | 285 | ? make_uninit_string (nbytes) |
| 276 | : make_uninit_multibyte_string (nchars, nbytes); | 286 | : make_uninit_multibyte_string (nchars, nbytes); |