aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-11-01 07:03:57 +0000
committerRichard M. Stallman1994-11-01 07:03:57 +0000
commit0b39d75da88f6e94ece604239290aceaf6e29c13 (patch)
treed50237db1a10297d0f9cacc047f1bebd30af0b9a /src
parentbad95d8f8d11090f3d3e05709f06d1ef2d7dd288 (diff)
downloademacs-0b39d75da88f6e94ece604239290aceaf6e29c13.tar.gz
emacs-0b39d75da88f6e94ece604239290aceaf6e29c13.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/dired.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/dired.c b/src/dired.c
index b8ba01b5edd..a9a911de145 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -195,7 +195,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\
195 int total = len + index; 195 int total = len + index;
196#ifndef VMS 196#ifndef VMS
197 if (length == 0 197 if (length == 0
198 || XSTRING (dirname)->data[length - 1] != '/') 198 || !IS_ANY_SEP (XSTRING (dirname)->data[length - 1]))
199 total++; 199 total++;
200#endif /* VMS */ 200#endif /* VMS */
201 201
@@ -204,8 +204,8 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\
204 index); 204 index);
205#ifndef VMS 205#ifndef VMS
206 if (length == 0 206 if (length == 0
207 || XSTRING (dirname)->data[length - 1] != '/') 207 || IS_ANY_SEP (XSTRING (dirname)->data[length - 1]))
208 XSTRING (name)->data[index++] = '/'; 208 XSTRING (name)->data[index++] = DIRECTORY_SEP;
209#endif /* VMS */ 209#endif /* VMS */
210 bcopy (dp->d_name, XSTRING (name)->data + index, len); 210 bcopy (dp->d_name, XSTRING (name)->data + index, len);
211 } 211 }
@@ -466,7 +466,7 @@ file_name_completion (file, dirname, all_flag, ver_flag)
466 if (directoryp 466 if (directoryp
467 && compare == matchsize 467 && compare == matchsize
468 && bestmatchsize > matchsize 468 && bestmatchsize > matchsize
469 && p1[matchsize] == '/') 469 && IS_ANY_SEP (p1[matchsize]))
470 matchsize++; 470 matchsize++;
471 bestmatchsize = matchsize; 471 bestmatchsize = matchsize;
472 } 472 }
@@ -500,8 +500,8 @@ file_name_completion_stat (dirname, dp, st_addr)
500 500
501 bcopy (XSTRING (dirname)->data, fullname, pos); 501 bcopy (XSTRING (dirname)->data, fullname, pos);
502#ifndef VMS 502#ifndef VMS
503 if (fullname[pos - 1] != '/') 503 if (!IS_DIRECTORY_SEP (fullname[pos - 1]))
504 fullname[pos++] = '/'; 504 fullname[pos++] = DIRECTORY_SEP;
505#endif 505#endif
506 506
507 bcopy (dp->d_name, fullname + pos, len); 507 bcopy (dp->d_name, fullname + pos, len);
@@ -657,13 +657,24 @@ If file does not exist, returns nil.")
657 else /* if we can't tell, assume worst */ 657 else /* if we can't tell, assume worst */
658 values[9] = Qt; 658 values[9] = Qt;
659#else /* file gid will be egid */ 659#else /* file gid will be egid */
660#ifdef WINDOWSNT
661 values[9] = Qnil; /* sorry, no group IDs on NT */
662#else /* not WINDOWSNT */
660 values[9] = (s.st_gid != getegid ()) ? Qt : Qnil; 663 values[9] = (s.st_gid != getegid ()) ? Qt : Qnil;
664#endif /* not WINDOWSNT */
661#endif /* BSD4_2 (or BSD4_3) */ 665#endif /* BSD4_2 (or BSD4_3) */
662#ifdef BSD4_3 666#ifdef BSD4_3
663#undef BSD4_2 /* ok, you can look again without throwing up */ 667#undef BSD4_2 /* ok, you can look again without throwing up */
664#endif 668#endif
669#ifdef WINDOWSNT
670 /* NT inodes are 64 bits, so we need to dance a little... */
671 if (!get_inode_and_device_vals (filename, &values[10], &values[11])) { ????
672 return Qnil;
673 }
674#else /* not WINDOWSNT */
665 values[10] = make_number (s.st_ino); 675 values[10] = make_number (s.st_ino);
666 values[11] = make_number (s.st_dev); 676 values[11] = make_number (s.st_dev);
677#endif /* not WINDOWSNT */
667 return Flist (sizeof(values) / sizeof(values[0]), values); 678 return Flist (sizeof(values) / sizeof(values[0]), values);
668} 679}
669 680