changeset 17592:6a190274d2e7

(Fexpand_file_name): Check length > 0 when necessary.
author Richard M. Stallman <rms@gnu.org>
date Tue, 29 Apr 1997 00:51:47 +0000
parents b2c8fb8139c8
children f3bbebd5c01d
files src/fileio.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Tue Apr 29 00:23:40 1997 +0000
+++ b/src/fileio.c	Tue Apr 29 00:51:47 1997 +0000
@@ -1251,7 +1251,7 @@
       /* Get rid of any slash at the end of newdir, unless newdir is
        just // (an incomplete UNC name). */
       length = strlen (newdir);
-      if (IS_DIRECTORY_SEP (newdir[length - 1])
+      if (length > 0 && IS_DIRECTORY_SEP (newdir[length - 1])
 #ifdef WINDOWSNT
 	  && !(length == 2 && IS_DIRECTORY_SEP (newdir[0]))
 #endif