summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-08-04 22:51:22 +0000
committerRichard M. Stallman <rms@gnu.org>1993-08-04 22:51:22 +0000
commit298b760ea5b6c1ccc07290160eb60dc1d63ca1a3 (patch)
tree5c06227475c565440d2f119840c57bbfe49fa3c4
parent75993094ccf8ce38e22837b1ca20187513a8034d (diff)
downloademacs-298b760ea5b6c1ccc07290160eb60dc1d63ca1a3.tar.gz
emacs-298b760ea5b6c1ccc07290160eb60dc1d63ca1a3.tar.bz2
emacs-298b760ea5b6c1ccc07290160eb60dc1d63ca1a3.zip
(expand_and_dir_to_file): Remove final / by copying abspath.
-rw-r--r--src/fileio.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/fileio.c b/src/fileio.c
index f4537ba0fda..6a94b2c34da 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1506,11 +1506,7 @@ duplicates what `expand-file-name' does.")
}
/* A slightly faster and more convenient way to get
- (directory-file-name (expand-file-name FOO)). The return value may
- 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. */
+ (directory-file-name (expand-file-name FOO)). */
Lisp_Object
expand_and_dir_to_file (filename, defdir)
@@ -1530,11 +1526,8 @@ expand_and_dir_to_file (filename, defdir)
stat behaves differently depending! */
if (XSTRING (abspath)->size > 1
&& XSTRING (abspath)->data[XSTRING (abspath)->size - 1] == '/')
- {
- if (EQ (abspath, filename))
- abspath = Fcopy_sequence (abspath);
- XSTRING (abspath)->data[XSTRING (abspath)->size - 1] = 0;
- }
+ abspath = Fsubstring (abspath, make_number (0),
+ make_number (XSTRING (abspath)->size - 1));
#endif
return abspath;
}