]> code.delx.au - gnu-emacs/blobdiff - src/dired.c
(set_internal): Properly compare lisp objects.
[gnu-emacs] / src / dired.c
index 12406b8041b11f2275eb57dfc2511762750e4388..2e72c4706dea9d0334526e25547b92c5a0251801 100644 (file)
@@ -31,6 +31,10 @@ Boston, MA 02111-1307, USA.  */
 #include <rmsdef.h>
 #endif
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
 /* The d_nameln member of a struct dirent includes the '\0' character
    on some systems, but not on others.  What's worse, you can't tell
    at compile-time which one it will be, since it really depends on
@@ -183,7 +187,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\
     report_file_error ("Opening directory", Fcons (directory, Qnil));
 
   list = Qnil;
-  dirnamelen = XSTRING (encoded_directory)->size;
+  dirnamelen = STRING_BYTES (XSTRING (encoded_directory));
   re_match_object = Qt;
 
   /* Decide whether we need to add a directory separator.  */
@@ -191,7 +195,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\
   if (dirnamelen == 0
       || !IS_ANY_SEP (XSTRING (encoded_directory)->data[dirnamelen - 1]))
     needsep = 1;
-#endif /* VMS */
+#endif /* not VMS */
 
   GCPRO2 (encoded_directory, list);
 
@@ -214,7 +218,8 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\
                  int total = len + dirnamelen;
                  int nchars;
 
-                 name = make_uninit_string (total + needsep);
+                 name = make_uninit_multibyte_string (total + needsep,
+                                                      total + needsep);
                  bcopy (XSTRING (encoded_directory)->data, XSTRING (name)->data,
                         dirnamelen);
                  if (needsep)
@@ -294,6 +299,8 @@ These are all file names in directory DIRECTORY which begin with FILE.")
   return file_name_completion (file, directory, 1, 0);
 }
 
+static int file_name_completion_stat ();
+
 Lisp_Object
 file_name_completion (file, dirname, all_flag, ver_flag)
      Lisp_Object file, dirname;
@@ -546,6 +553,7 @@ file_name_completion (file, dirname, all_flag, ver_flag)
   return Fsignal (Qquit, Qnil);
 }
 
+static int
 file_name_completion_stat (dirname, dp, st_addr)
      Lisp_Object dirname;
      DIRENTRY *dp;
@@ -741,6 +749,7 @@ If file does not exist, returns nil.")
   return Flist (sizeof(values) / sizeof(values[0]), values);
 }
 \f
+void
 syms_of_dired ()
 {
   Qdirectory_files = intern ("directory-files");