Commit 298b760e authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(expand_and_dir_to_file): Remove final / by copying abspath.

parent 75993094
...@@ -1506,11 +1506,7 @@ duplicates what `expand-file-name' does.") ...@@ -1506,11 +1506,7 @@ duplicates what `expand-file-name' does.")
} }
/* A slightly faster and more convenient way to get /* A slightly faster and more convenient way to get
(directory-file-name (expand-file-name FOO)). The return value may (directory-file-name (expand-file-name FOO)). */
have had its last character zapped with a '\0' character, meaning
that it is acceptable to system calls, but not to other lisp
functions. Callers should make sure that the return value doesn't
escape. */
Lisp_Object Lisp_Object
expand_and_dir_to_file (filename, defdir) expand_and_dir_to_file (filename, defdir)
...@@ -1530,11 +1526,8 @@ expand_and_dir_to_file (filename, defdir) ...@@ -1530,11 +1526,8 @@ expand_and_dir_to_file (filename, defdir)
stat behaves differently depending! */ stat behaves differently depending! */
if (XSTRING (abspath)->size > 1 if (XSTRING (abspath)->size > 1
&& XSTRING (abspath)->data[XSTRING (abspath)->size - 1] == '/') && XSTRING (abspath)->data[XSTRING (abspath)->size - 1] == '/')
{ abspath = Fsubstring (abspath, make_number (0),
if (EQ (abspath, filename)) make_number (XSTRING (abspath)->size - 1));
abspath = Fcopy_sequence (abspath);
XSTRING (abspath)->data[XSTRING (abspath)->size - 1] = 0;
}
#endif #endif
return abspath; return abspath;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment