diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c index 352129a0853..aef7a01e0a3 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1419,7 +1419,18 @@ See also the function `substitute-in-file-name'.") | |||
| 1419 | { | 1419 | { |
| 1420 | #ifndef VMS | 1420 | #ifndef VMS |
| 1421 | if (nm[0] == 0 || IS_DIRECTORY_SEP (nm[0])) | 1421 | if (nm[0] == 0 || IS_DIRECTORY_SEP (nm[0])) |
| 1422 | strcpy (target, newdir); | 1422 | { |
| 1423 | #ifdef WINDOWSNT | ||
| 1424 | /* If newdir is effectively "C:/", then the drive letter will have | ||
| 1425 | been stripped and newdir will be "/". Concatenating with an | ||
| 1426 | absolute directory in nm produces "//", which will then be | ||
| 1427 | incorrectly treated as a network share. Ignore newdir in | ||
| 1428 | this case (keeping the drive letter). */ | ||
| 1429 | if (!(drive && nm[0] && IS_DIRECTORY_SEP (newdir[0]) | ||
| 1430 | && newdir[1] == '\0')) | ||
| 1431 | #endif | ||
| 1432 | strcpy (target, newdir); | ||
| 1433 | } | ||
| 1423 | else | 1434 | else |
| 1424 | #endif | 1435 | #endif |
| 1425 | file_name_as_directory (target, newdir); | 1436 | file_name_as_directory (target, newdir); |