# HG changeset patch
# User Richard M. Stallman <rms@gnu.org>
# Date 831923136 0
# Node ID cc264dd966cd82ef9c44503c6e7eade45905386e
# Parent  f64513177b1153435d721a9e69dab577df729884
(Fmsdos_downcase_filename): Don't change the argument, return a copy.

diff -r f64513177b11 -r cc264dd966cd src/msdos.c
--- a/src/msdos.c	Sun May 12 17:43:29 1996 +0000
+++ b/src/msdos.c	Sun May 12 17:45:36 1996 +0000
@@ -2246,14 +2246,21 @@
 DEFUN ("msdos-downcase-filename", Fmsdos_downcase_filename, Smsdos_downcase_filename,
        1, 1, 0,
   "Convert alphabetic characters in FILENAME to lower case and return that.\n\
-When long filenames are supported, doesn't change FILENAME.")
+When long filenames are supported, doesn't change FILENAME.\n\
+If FILENAME is not a string, returns nil.\n\
+The argument object is never altered--the value is a copy.")
   (filename)
      Lisp_Object filename;
 {
-  char *fname = XSTRING (filename)->data;
-
-  msdos_downcase_filename (fname);
-  return make_string (fname, XSTRING (filename)->size);
+  char *fname;
+  Lisp_Object tem;
+
+  if (! STRINGP (filename))
+    return Qnil;
+
+  tem = Fcopy_sequence (filename);
+  msdos_downcase_filename (XSTRING (tem)->data);
+  return tem;
 }
 
 /* The Emacs root directory as determined by init_environment.  */