From: Richard M. Stallman Date: Tue, 27 Jan 1998 20:07:30 +0000 (+0000) Subject: (file_name_as_directory): For an empty name, return "/". X-Git-Tag: emacs-20.3~2284 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8aa3a244a3eb61c7eddccf41a6c963530361276a;p=emacs.git (file_name_as_directory): For an empty name, return "/". --- diff --git a/src/fileio.c b/src/fileio.c index 49d7de52bbe..6993003a8f1 100644 --- a/src/fileio.c +++ b/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] == '>')