1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-31 20:02:42 +00:00

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

This commit is contained in:
Richard M. Stallman 1998-01-27 20:07:30 +00:00
parent a2286b5c11
commit 8aa3a244a3

View File

@ -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] == '>')