Commit 15fc2f8c authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(Fexpand_file_name): Check length > 0 when necessary.

parent fcb242c9
......@@ -1251,7 +1251,7 @@ See also the function `substitute-in-file-name'.")
/* 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
......
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