]> code.delx.au - gnu-emacs/blobdiff - src/dired.c
Rewritten to take advantage of shy-groups and
[gnu-emacs] / src / dired.c
index d9c2ab0f865dfd173b1dcb4486969f66268cab3e..bedda2a7f13233847034e886247d928e6d23acc6 100644 (file)
@@ -1,5 +1,5 @@
 /* Lisp functions for making directory listings.
-   Copyright (C) 1985, 1986, 1993, 1994 Free Software Foundation, Inc.
+   Copyright (C) 1985, 1986, 1993, 1994, 1999 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -25,6 +25,8 @@ Boston, MA 02111-1307, USA.  */
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#include "systime.h"
+
 #ifdef VMS
 #include <string.h>
 #include <rms.h>
@@ -64,6 +66,8 @@ Boston, MA 02111-1307, USA.  */
 #endif
 #endif /* not NONSYSTEM_DIR_LIBRARY */
 
+#include <sys/stat.h>
+
 #ifndef MSDOS
 #define DIRENTRY struct direct
 
@@ -89,6 +93,9 @@ extern struct direct *readdir ();
 /* Returns a search buffer, with a fastmap allocated and ready to go.  */
 extern struct re_pattern_buffer *compile_pattern ();
 
+/* From filemode.c.  Can't go in Lisp.h because of `stat'.  */
+extern void filemodestring P_ ((struct stat *, char *));
+
 #define min(a, b) ((a) < (b) ? (a) : (b))
 
 /* if system does not have symbolic links, it does not have lstat.
@@ -790,7 +797,7 @@ If file does not exist, returns nil.")
   values[4] = make_time (s.st_atime);
   values[5] = make_time (s.st_mtime);
   values[6] = make_time (s.st_ctime);
-  values[7] = make_number ((int) s.st_size);
+  values[7] = make_number (s.st_size);
   /* If the size is out of range for an integer, return a float.  */
   if (XINT (values[7]) != s.st_size)
     values[7] = make_float ((double)s.st_size);
@@ -822,7 +829,14 @@ If file does not exist, returns nil.")
   else
     /* But keep the most common cases as integers.  */
     values[10] = make_number (s.st_ino);
-  values[11] = make_number (s.st_dev);
+
+  /* Likewise for device.  */
+  if (s.st_dev & (((EMACS_INT) (-1)) << VALBITS))
+    values[11] = Fcons (make_number (s.st_dev >> 16),
+                       make_number (s.st_dev & 0xffff));
+  else
+    values[11] = make_number (s.st_dev);
+
   return Flist (sizeof(values) / sizeof(values[0]), values);
 }