diff options
| author | Eli Zaretskii | 2008-04-26 08:23:21 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2008-04-26 08:23:21 +0000 |
| commit | 01388a3dd2bb36ab8deeb59f62b35a47688ea22a (patch) | |
| tree | c41e09be084265c9ef6477aae4c6811b8db48f26 | |
| parent | 341dd15a7bd9d0b4adff846e94289b3e1877eed1 (diff) | |
| download | emacs-01388a3dd2bb36ab8deeb59f62b35a47688ea22a.tar.gz emacs-01388a3dd2bb36ab8deeb59f62b35a47688ea22a.zip | |
(Ffile_attributes) [WINDOWSNT]: Undo change from 2008-03-31, it's not needed
anymore with `struct stat' definition on nt/inc/sys/stat.h. Undo changes
from 2007-01-12 and 2007-01-13 for the same reasons.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/dired.c | 32 |
2 files changed, 16 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1a842da63df..bac04275455 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2008-04-26 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * dired.c (Ffile_attributes) [WINDOWSNT]: Undo change from | ||
| 4 | 2008-03-31, it's not needed anymore with `struct stat' definition | ||
| 5 | on nt/inc/sys/stat.h. Undo changes from 2007-01-12 and 2007-01-13 | ||
| 6 | for the same reasons. | ||
| 7 | |||
| 1 | 2008-04-25 Chip Coldwell <coldwell@redhat.com> | 8 | 2008-04-25 Chip Coldwell <coldwell@redhat.com> |
| 2 | 9 | ||
| 3 | * m/sparc.h: Additional redefinitions for GNU/Linux. | 10 | * m/sparc.h: Additional redefinitions for GNU/Linux. |
diff --git a/src/dired.c b/src/dired.c index f8b8f2dc84a..85558592be6 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -942,7 +942,7 @@ Elements of the attribute list are: | |||
| 942 | char modes[10]; | 942 | char modes[10]; |
| 943 | Lisp_Object handler; | 943 | Lisp_Object handler; |
| 944 | struct gcpro gcpro1; | 944 | struct gcpro gcpro1; |
| 945 | EMACS_INT uid, gid, ino; | 945 | EMACS_INT ino; |
| 946 | 946 | ||
| 947 | filename = Fexpand_file_name (filename, Qnil); | 947 | filename = Fexpand_file_name (filename, Qnil); |
| 948 | 948 | ||
| @@ -977,34 +977,20 @@ Elements of the attribute list are: | |||
| 977 | #endif | 977 | #endif |
| 978 | } | 978 | } |
| 979 | values[1] = make_number (s.st_nlink); | 979 | values[1] = make_number (s.st_nlink); |
| 980 | /* When make_fixnum_or_float is called below with types that are | ||
| 981 | shorter than an int (e.g., `short'), GCC whines about comparison | ||
| 982 | being always false due to limited range of data type. Fix by | ||
| 983 | copying s.st_uid and s.st_gid into int variables. */ | ||
| 984 | #ifdef WINDOWSNT | ||
| 985 | /* Windows uses signed short for the uid and gid in the stat structure, | ||
| 986 | but we use an int for getuid (limited to the range 0-60000). | ||
| 987 | So users with uid > 32767 need their uid patched back here. */ | ||
| 988 | uid = (unsigned short) s.st_uid; | ||
| 989 | gid = (unsigned short) s.st_gid; | ||
| 990 | #else | ||
| 991 | uid = s.st_uid; | ||
| 992 | gid = s.st_gid; | ||
| 993 | #endif | ||
| 994 | if (NILP (id_format) || EQ (id_format, Qinteger)) | 980 | if (NILP (id_format) || EQ (id_format, Qinteger)) |
| 995 | { | 981 | { |
| 996 | values[2] = make_fixnum_or_float (uid); | 982 | values[2] = make_fixnum_or_float (s.st_uid); |
| 997 | values[3] = make_fixnum_or_float (gid); | 983 | values[3] = make_fixnum_or_float (s.st_gid); |
| 998 | } | 984 | } |
| 999 | else | 985 | else |
| 1000 | { | 986 | { |
| 1001 | BLOCK_INPUT; | 987 | BLOCK_INPUT; |
| 1002 | pw = (struct passwd *) getpwuid (uid); | 988 | pw = (struct passwd *) getpwuid (s.st_uid); |
| 1003 | values[2] = (pw ? build_string (pw->pw_name) | 989 | values[2] = (pw ? build_string (pw->pw_name) |
| 1004 | : make_fixnum_or_float (uid)); | 990 | : make_fixnum_or_float (s.st_uid)); |
| 1005 | gr = (struct group *) getgrgid (gid); | 991 | gr = (struct group *) getgrgid (s.st_gid); |
| 1006 | values[3] = (gr ? build_string (gr->gr_name) | 992 | values[3] = (gr ? build_string (gr->gr_name) |
| 1007 | : make_fixnum_or_float (gid)); | 993 | : make_fixnum_or_float (s.st_gid)); |
| 1008 | UNBLOCK_INPUT; | 994 | UNBLOCK_INPUT; |
| 1009 | } | 995 | } |
| 1010 | values[4] = make_time (s.st_atime); | 996 | values[4] = make_time (s.st_atime); |
| @@ -1026,11 +1012,11 @@ Elements of the attribute list are: | |||
| 1026 | if (! NILP (dirname)) | 1012 | if (! NILP (dirname)) |
| 1027 | encoded = ENCODE_FILE (dirname); | 1013 | encoded = ENCODE_FILE (dirname); |
| 1028 | if (! NILP (dirname) && stat (SDATA (encoded), &sdir) == 0) | 1014 | if (! NILP (dirname) && stat (SDATA (encoded), &sdir) == 0) |
| 1029 | values[9] = (sdir.st_gid != gid) ? Qt : Qnil; | 1015 | values[9] = (sdir.st_gid != s.st_gid) ? Qt : Qnil; |
| 1030 | else /* if we can't tell, assume worst */ | 1016 | else /* if we can't tell, assume worst */ |
| 1031 | values[9] = Qt; | 1017 | values[9] = Qt; |
| 1032 | #else /* file gid will be egid */ | 1018 | #else /* file gid will be egid */ |
| 1033 | values[9] = (gid != getegid ()) ? Qt : Qnil; | 1019 | values[9] = (s.st_gid != getegid ()) ? Qt : Qnil; |
| 1034 | #endif /* BSD4_2 (or BSD4_3) */ | 1020 | #endif /* BSD4_2 (or BSD4_3) */ |
| 1035 | /* Shut up GCC warnings in FIXNUM_OVERFLOW_P below. */ | 1021 | /* Shut up GCC warnings in FIXNUM_OVERFLOW_P below. */ |
| 1036 | if (sizeof (s.st_ino) > sizeof (ino)) | 1022 | if (sizeof (s.st_ino) > sizeof (ino)) |