changeset 21261:edaef0e79ff0

(Fdirectory_files): In FULL case, compute number of characters
author Richard M. Stallman <rms@gnu.org>
date Sat, 21 Mar 1998 18:23:09 +0000
parents 4ac9ba6e745d
children b3f406b3c297
files src/dired.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/dired.c	Sat Mar 21 18:09:01 1998 +0000
+++ b/src/dired.c	Sat Mar 21 18:23:09 1998 +0000
@@ -206,6 +206,7 @@
 		  int afterdirindex = dirnamelen;
 		  int total = len + dirnamelen;
 		  int needsep = 0;
+		  int nchars;
 
 		  /* Decide whether we need to add a directory separator.  */
 #ifndef VMS
@@ -221,6 +222,11 @@
 		    XSTRING (name)->data[afterdirindex++] = DIRECTORY_SEP;
 		  bcopy (dp->d_name,
 			 XSTRING (name)->data + afterdirindex, len);
+		  nchars = chars_in_text (dp->d_name,
+					  afterdirindex + len);
+		  XSTRING (name)->size = nchars;
+		  if (nchars == STRING_BYTES (XSTRING (name)))
+		    SET_STRING_BYTES (XSTRING (name), -1);
 		}
 	      else
 		name = make_string (dp->d_name, len);