Mercurial > emacs
changeset 19754:380cbf03df01
(Fexpand_file_name): If default dir isn't string, use `/'.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 05 Sep 1997 01:21:43 +0000 |
parents | 777adb2936b3 |
children | 4b765ab0b8d1 |
files | src/fileio.c |
diffstat | 1 files changed, 12 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fileio.c Thu Sep 04 20:25:56 1997 +0000 +++ b/src/fileio.c Fri Sep 05 01:21:43 1997 +0000 @@ -794,7 +794,7 @@ An initial `~/' expands to your home directory.\n\ An initial `~USER/' expands to USER's home directory.\n\ See also the function `substitute-in-file-name'.") - (name, default_directory) + (name, default_directory) Lisp_Object name, default_directory; { unsigned char *nm; @@ -829,7 +829,8 @@ /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */ if (NILP (default_directory)) default_directory = current_buffer->directory; - CHECK_STRING (default_directory, 1); + if (! STRINGP (default_directory)) + default_directory = build_string ("/"); if (!NILP (default_directory)) { @@ -1242,7 +1243,7 @@ } /* Keep only a prefix from newdir if nm starts with slash - (//server/share for UNC, nothing otherwise). */ + (//server/share for UNC, nothing otherwise). */ if (IS_DIRECTORY_SEP (nm[0]) && collapse_newdir) { #ifdef WINDOWSNT @@ -1265,7 +1266,7 @@ if (newdir) { /* Get rid of any slash at the end of newdir, unless newdir is - just // (an incomplete UNC name). */ + just // (an incomplete UNC name). */ length = strlen (newdir); if (length > 0 && IS_DIRECTORY_SEP (newdir[length - 1]) #ifdef WINDOWSNT @@ -1369,7 +1370,7 @@ else if (IS_DIRECTORY_SEP (p[0]) && IS_DIRECTORY_SEP (p[1]) #if defined (APOLLO) || defined (WINDOWSNT) /* // at start of filename is meaningful in Apollo - and WindowsNT systems */ + and WindowsNT systems. */ && o != target #endif /* APOLLO || WINDOWSNT */ ) @@ -1464,7 +1465,7 @@ nm = XSTRING (name)->data; /* If nm is absolute, flush ...// and detect /./ and /../. - If no /./ or /../ we can return right away. */ + If no /./ or /../ we can return right away. */ if ( nm[0] == '/' #ifdef VMS @@ -1478,7 +1479,7 @@ { if (p[0] == '/' && p[1] == '/' #ifdef APOLLO - /* // at start of filename is meaningful on Apollo system */ + /* // at start of filename is meaningful on Apollo system. */ && nm != p #endif /* APOLLO */ ) @@ -1711,7 +1712,7 @@ } else if (!strncmp (p, "//", 2) #ifdef APOLLO - /* // at start of filename is meaningful in Apollo system */ + /* // at start of filename is meaningful in Apollo system. */ && o != target #endif /* APOLLO */ ) @@ -1787,14 +1788,14 @@ #endif endp = nm + XSTRING (filename)->size; - /* If /~ or // appears, discard everything through first slash. */ + /* If /~ or // appears, discard everything through first slash. */ for (p = nm; p != endp; p++) { if ((p[0] == '~' #if defined (APOLLO) || defined (WINDOWSNT) /* // at start of file name is meaningful in Apollo and - WindowsNT systems */ + WindowsNT systems. */ || (IS_DIRECTORY_SEP (p[0]) && p - 1 != nm) #else /* not (APOLLO || WINDOWSNT) */ || IS_DIRECTORY_SEP (p[0]) @@ -1928,7 +1929,7 @@ *x = 0; - /* If /~ or // appears, discard everything through first slash. */ + /* If /~ or // appears, discard everything through first slash. */ for (p = xnm; p != x; p++) if ((p[0] == '~'