Commit 8aa3a244 authored by Richard M. Stallman's avatar Richard M. Stallman

(file_name_as_directory): For an empty name, return "/".

parent a2286b5c
......@@ -484,11 +484,15 @@ file_name_as_directory (out, in)
{
int size = strlen (in) - 1;
if (size < 0)
error ("Empty file name");
strcpy (out, in);
if (size < 0)
{
out[0] = '/';
out[1] = 0;
return out;
}
#ifdef VMS
/* Is it already a directory string? */
if (in[size] == ':' || in[size] == ']' || in[size] == '>')
......
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