aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorStephen Leake2018-12-13 14:39:02 -0800
committerStephen Leake2018-12-13 14:39:02 -0800
commit87bef630bf0f45e8da74e43ba614aa2292b296ef (patch)
treeefdead3c0d7dd227bacbd4dfc5c1ff9b4d5c13c3 /src/fileio.c
parent4d3f7b77cc7dea072d2ecb9f137c2e497bc52da1 (diff)
parentd08b75abe0f0cf9ade812b189c374809a2c7836e (diff)
downloademacs-87bef630bf0f45e8da74e43ba614aa2292b296ef.tar.gz
emacs-87bef630bf0f45e8da74e43ba614aa2292b296ef.zip
Merge commit 'd08b75abe0f0cf9ade812b189c374809a2c7836e'
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c28
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)