aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-01-27 20:07:30 +0000
committerRichard M. Stallman1998-01-27 20:07:30 +0000
commit8aa3a244a3eb61c7eddccf41a6c963530361276a (patch)
tree215501ec05d400a4dcadafa2aad114b171a20e59 /src
parenta2286b5c11bccfd1ae91b1bf1ff565c8996f976f (diff)
downloademacs-8aa3a244a3eb61c7eddccf41a6c963530361276a.tar.gz
emacs-8aa3a244a3eb61c7eddccf41a6c963530361276a.zip
(file_name_as_directory): For an empty name, return "/".
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c10
1 files changed, 7 insertions, 3 deletions
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)
484{ 484{
485 int size = strlen (in) - 1; 485 int size = strlen (in) - 1;
486 486
487 if (size < 0)
488 error ("Empty file name");
489
490 strcpy (out, in); 487 strcpy (out, in);
491 488
489 if (size < 0)
490 {
491 out[0] = '/';
492 out[1] = 0;
493 return out;
494 }
495
492#ifdef VMS 496#ifdef VMS
493 /* Is it already a directory string? */ 497 /* Is it already a directory string? */
494 if (in[size] == ':' || in[size] == ']' || in[size] == '>') 498 if (in[size] == ':' || in[size] == ']' || in[size] == '>')