Mercurial > vim
comparison src/fileio.c @ 15794:0d8291665b59 v8.1.0904
patch 8.1.0904: USE_LONG_FNAME never defined
commit https://github.com/vim/vim/commit/00f148d2f24fb955ab36b0833811582c58b2cf2f
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 12 22:37:27 2019 +0100
patch 8.1.0904: USE_LONG_FNAME never defined
Problem: USE_LONG_FNAME never defined.
Solution: Remove using USE_LONG_FNAME. (Ken Takata, closes https://github.com/vim/vim/issues/3938)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 12 Feb 2019 22:45:06 +0100 |
parents | 7f91de3f5e35 |
children | 40336d427dd2 |
comparison
equal
deleted
inserted
replaced
15793:544b17464448 | 15794:0d8291665b59 |
---|---|
6222 * Then truncate what is after the '/', '\' or ':' to 8 characters for | 6222 * Then truncate what is after the '/', '\' or ':' to 8 characters for |
6223 * MSDOS and 26 characters for AMIGA, a lot more for UNIX. | 6223 * MSDOS and 26 characters for AMIGA, a lot more for UNIX. |
6224 */ | 6224 */ |
6225 for (ptr = retval + fnamelen; ptr > retval; MB_PTR_BACK(retval, ptr)) | 6225 for (ptr = retval + fnamelen; ptr > retval; MB_PTR_BACK(retval, ptr)) |
6226 { | 6226 { |
6227 if (*ext == '.' | 6227 if (*ext == '.' && shortname) |
6228 #ifdef USE_LONG_FNAME | |
6229 && (!USE_LONG_FNAME || shortname) | |
6230 #else | |
6231 && shortname | |
6232 #endif | |
6233 ) | |
6234 if (*ptr == '.') /* replace '.' by '_' */ | 6228 if (*ptr == '.') /* replace '.' by '_' */ |
6235 *ptr = '_'; | 6229 *ptr = '_'; |
6236 if (vim_ispathsep(*ptr)) | 6230 if (vim_ispathsep(*ptr)) |
6237 { | 6231 { |
6238 ++ptr; | 6232 ++ptr; |
6247 s = ptr + STRLEN(ptr); | 6241 s = ptr + STRLEN(ptr); |
6248 | 6242 |
6249 /* | 6243 /* |
6250 * For 8.3 file names we may have to reduce the length. | 6244 * For 8.3 file names we may have to reduce the length. |
6251 */ | 6245 */ |
6252 #ifdef USE_LONG_FNAME | |
6253 if (!USE_LONG_FNAME || shortname) | |
6254 #else | |
6255 if (shortname) | 6246 if (shortname) |
6256 #endif | |
6257 { | 6247 { |
6258 /* | 6248 /* |
6259 * If there is no file name, or the file name ends in '/', and the | 6249 * If there is no file name, or the file name ends in '/', and the |
6260 * extension starts with '.', put a '_' before the dot, because just | 6250 * extension starts with '.', put a '_' before the dot, because just |
6261 * ".ext" is invalid. | 6251 * ".ext" is invalid. |
6289 * extension, it may need to be truncated | 6279 * extension, it may need to be truncated |
6290 */ | 6280 */ |
6291 else if ((int)STRLEN(e) + extlen > 4) | 6281 else if ((int)STRLEN(e) + extlen > 4) |
6292 s = e + 4 - extlen; | 6282 s = e + 4 - extlen; |
6293 } | 6283 } |
6294 #if defined(USE_LONG_FNAME) || defined(WIN3264) | 6284 #ifdef WIN3264 |
6295 /* | 6285 /* |
6296 * If there is no file name, and the extension starts with '.', put a | 6286 * If there is no file name, and the extension starts with '.', put a |
6297 * '_' before the dot, because just ".ext" may be invalid if it's on a | 6287 * '_' before the dot, because just ".ext" may be invalid if it's on a |
6298 * FAT partition, and on HPFS it doesn't matter. | 6288 * FAT partition, and on HPFS it doesn't matter. |
6299 */ | 6289 */ |
6308 STRCPY(s, ext); | 6298 STRCPY(s, ext); |
6309 | 6299 |
6310 /* | 6300 /* |
6311 * Prepend the dot. | 6301 * Prepend the dot. |
6312 */ | 6302 */ |
6313 if (prepend_dot && !shortname && *(e = gettail(retval)) != '.' | 6303 if (prepend_dot && !shortname && *(e = gettail(retval)) != '.') |
6314 #ifdef USE_LONG_FNAME | |
6315 && USE_LONG_FNAME | |
6316 #endif | |
6317 ) | |
6318 { | 6304 { |
6319 STRMOVE(e + 1, e); | 6305 STRMOVE(e + 1, e); |
6320 *e = '.'; | 6306 *e = '.'; |
6321 } | 6307 } |
6322 | 6308 |