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:
parent
a2286b5c11
commit
8aa3a244a3
10
src/fileio.c
10
src/fileio.c
@ -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] == '>')
|
||||
|
Loading…
Reference in New Issue
Block a user