changeset 4451:73b91cd2c55e

(expand_and_dir_to_file): Remove final / by copying abspath.
author Richard M. Stallman <rms@gnu.org>
date Wed, 04 Aug 1993 22:51:22 +0000
parents 325bc5407213
children 9b4b1220bfe5
files src/fileio.c
diffstat 1 files changed, 3 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Wed Aug 04 08:20:00 1993 +0000
+++ b/src/fileio.c	Wed Aug 04 22:51:22 1993 +0000
@@ -1506,11 +1506,7 @@
 }
 
 /* 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 @@
      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;
 }