diff src/fileio.c @ 49191:9b836b1dabe5

(syms_of_fileio) <directory-sep-char>: Doc fix. (Fdo_auto_save): Add gcpros around Ffile_name_directory.
author Richard M. Stallman <rms@gnu.org>
date Mon, 13 Jan 2003 08:17:33 +0000
parents 0b4aeb4594ad
children 0064f690e77d
line wrap: on
line diff
--- a/src/fileio.c	Mon Jan 13 08:07:18 2003 +0000
+++ b/src/fileio.c	Mon Jan 13 08:17:33 2003 +0000
@@ -3263,12 +3263,6 @@
   if (!NILP (handler))
     return call2 (handler, Qfile_accessible_directory_p, filename);
 
-  /* It's an unlikely combination, but yes we really do need to gcpro:
-     Suppose that file-accessible-directory-p has no handler, but
-     file-directory-p does have a handler; this handler causes a GC which
-     relocates the string in `filename'; and finally file-directory-p
-     returns non-nil.  Then we would end up passing a garbaged string
-     to file-executable-p.  */
   GCPRO1 (filename);
   tem = (NILP (Ffile_directory_p (filename))
 	 || NILP (Ffile_executable_p (filename)));
@@ -5617,6 +5611,7 @@
   int count = SPECPDL_INDEX ();
   int orig_minibuffer_auto_raise = minibuffer_auto_raise;
   int old_message_p = 0;
+  struct gcpro gcpro1, gcpro2;
 
   if (max_specpdl_size < specpdl_size + 40)
     max_specpdl_size = specpdl_size + 40;
@@ -5653,11 +5648,14 @@
       if (!NILP (Vrun_hooks))
 	{
 	  Lisp_Object dir;
+	  dir = Qnil;
+	  GCPRO2 (dir, listfile);
 	  dir = Ffile_name_directory (listfile);
 	  if (NILP (Ffile_directory_p (dir)))
 	    internal_condition_case_1 (do_auto_save_make_dir,
 				       dir, Fcons (Fcons (Qfile_error, Qnil), Qnil),
 				       do_auto_save_eh);
+	  UNGCPRO;
 	}
       
       stream = fopen (SDATA (listfile), "w");
@@ -6353,10 +6351,7 @@
 
   DEFVAR_LISP ("directory-sep-char", &Vdirectory_sep_char,
 	       doc: /* Directory separator character for built-in functions that return file names.
-The value should be either ?/ or ?\\ (any other value is treated as ?\\).
-This variable affects the built-in functions only on Windows,
-on other platforms, it is initialized so that Lisp code can find out
-what the normal separator is.  */);
+The value is always ?/.  Don't use this variable, just use `/'.  */);
 
   DEFVAR_LISP ("file-name-handler-alist", &Vfile_name_handler_alist,
 	       doc: /* *Alist of elements (REGEXP . HANDLER) for file names handled specially.