changeset 9787:c55f03316095

Use macros IS_ANY_SEP, IS_DIRECTORY_SEP, and DIRECTORY_SEP. (file-attributes) [WINDOWSNT]: Set st_gid and st_uid to Qnil; use get_inode_and_device_vals to fake up inode number and device number.
author Richard M. Stallman <rms@gnu.org>
date Tue, 01 Nov 1994 07:03:57 +0000
parents 7f4b72244919
children cfc5a79852e8
files src/dired.c
diffstat 1 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/dired.c	Tue Nov 01 06:49:52 1994 +0000
+++ b/src/dired.c	Tue Nov 01 07:03:57 1994 +0000
@@ -195,7 +195,7 @@
 		  int total = len + index;
 #ifndef VMS
 		  if (length == 0
-		      || XSTRING (dirname)->data[length - 1] != '/')
+		      || !IS_ANY_SEP (XSTRING (dirname)->data[length - 1]))
 		    total++;
 #endif /* VMS */
 
@@ -204,8 +204,8 @@
 			 index);
 #ifndef VMS
 		  if (length == 0
-		      || XSTRING (dirname)->data[length - 1] != '/')
-		    XSTRING (name)->data[index++] = '/';
+		      || IS_ANY_SEP (XSTRING (dirname)->data[length - 1]))
+		    XSTRING (name)->data[index++] = DIRECTORY_SEP;
 #endif /* VMS */
 		  bcopy (dp->d_name, XSTRING (name)->data + index, len);
 		}
@@ -466,7 +466,7 @@
 	      if (directoryp
 		  && compare == matchsize
 		  && bestmatchsize > matchsize
-		  && p1[matchsize] == '/')
+		  && IS_ANY_SEP (p1[matchsize]))
 		matchsize++;
 	      bestmatchsize = matchsize;
 	    }
@@ -500,8 +500,8 @@
 
   bcopy (XSTRING (dirname)->data, fullname, pos);
 #ifndef VMS
-  if (fullname[pos - 1] != '/')
-    fullname[pos++] = '/';
+  if (!IS_DIRECTORY_SEP (fullname[pos - 1]))
+    fullname[pos++] = DIRECTORY_SEP;
 #endif
 
   bcopy (dp->d_name, fullname + pos, len);
@@ -657,13 +657,24 @@
   else					/* if we can't tell, assume worst */
     values[9] = Qt;
 #else					/* file gid will be egid */
+#ifdef WINDOWSNT
+  values[9] = Qnil;	/* sorry, no group IDs on NT */
+#else  /* not WINDOWSNT */
   values[9] = (s.st_gid != getegid ()) ? Qt : Qnil;
+#endif /* not WINDOWSNT */
 #endif	/* BSD4_2 (or BSD4_3) */
 #ifdef BSD4_3
 #undef BSD4_2 /* ok, you can look again without throwing up */
 #endif
+#ifdef WINDOWSNT
+  /* NT inodes are 64 bits, so we need to dance a little...  */
+  if (!get_inode_and_device_vals (filename, &values[10], &values[11])) {   ????
+      return Qnil;
+  }
+#else  /* not WINDOWSNT */
   values[10] = make_number (s.st_ino);
   values[11] = make_number (s.st_dev);
+#endif /* not WINDOWSNT */
   return Flist (sizeof(values) / sizeof(values[0]), values);
 }