diff options
Diffstat (limited to 'src/fileio.c')
| -rw-r--r-- | src/fileio.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c index d9795715f9e..687f6ec7452 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1692,6 +1692,34 @@ get_homedir (void) | |||
| 1692 | if (!home) | 1692 | if (!home) |
| 1693 | return ""; | 1693 | return ""; |
| 1694 | } | 1694 | } |
| 1695 | #ifdef DOS_NT | ||
| 1696 | /* If home is a drive-relative directory, expand it. */ | ||
| 1697 | if (IS_DRIVE (*home) | ||
| 1698 | && IS_DEVICE_SEP (home[1]) | ||
| 1699 | && !IS_DIRECTORY_SEP (home[2])) | ||
| 1700 | { | ||
| 1701 | # ifdef WINDOWSNT | ||
| 1702 | static char hdir[MAX_UTF8_PATH]; | ||
| 1703 | # else | ||
| 1704 | static char hdir[MAXPATHLEN]; | ||
| 1705 | # endif | ||
| 1706 | if (!getdefdir (c_toupper (*home) - 'A' + 1, hdir)) | ||
| 1707 | { | ||
| 1708 | hdir[0] = c_toupper (*home); | ||
| 1709 | hdir[1] = ':'; | ||
| 1710 | hdir[2] = '/'; | ||
| 1711 | hdir[3] = '\0'; | ||
| 1712 | } | ||
| 1713 | if (home[2]) | ||
| 1714 | { | ||
| 1715 | size_t homelen = strlen (hdir); | ||
| 1716 | if (!IS_DIRECTORY_SEP (hdir[homelen - 1])) | ||
| 1717 | strcat (hdir, "/"); | ||
| 1718 | strcat (hdir, home + 2); | ||
| 1719 | } | ||
| 1720 | home = hdir; | ||
| 1721 | } | ||
| 1722 | #endif | ||
| 1695 | if (IS_ABSOLUTE_FILE_NAME (home)) | 1723 | if (IS_ABSOLUTE_FILE_NAME (home)) |
| 1696 | return home; | 1724 | return home; |
| 1697 | if (!emacs_wd) | 1725 | if (!emacs_wd) |