changeset 20790:7fd6ce99f389

(file_name_as_directory): For an empty name, return "/".
author Richard M. Stallman <rms@gnu.org>
date Tue, 27 Jan 1998 20:07:30 +0000
parents 140b6fdd53d0
children 0c51c56d0a4f
files src/fileio.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Tue Jan 27 20:06:51 1998 +0000
+++ b/src/fileio.c	Tue Jan 27 20:07:30 1998 +0000
@@ -484,10 +484,14 @@
 {
   int size = strlen (in) - 1;
 
+  strcpy (out, in);
+
   if (size < 0)
-    error ("Empty file name");
-
-  strcpy (out, in);
+    {
+      out[0] = '/';
+      out[1] = 0;
+      return out;
+    }
 
 #ifdef VMS
   /* Is it already a directory string? */