Mercurial > emacs
comparison src/dired.c @ 80399:780cad93de3d
(Ffile_attributes) [WINDOWSNT]: Cast uid and gid to unsigned.
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Mon, 31 Mar 2008 14:22:12 +0000 |
parents | fc2bcd2a8aad |
children | 71c3cb311bff |
comparison
equal
deleted
inserted
replaced
80398:1a844d29f8e3 | 80399:780cad93de3d |
---|---|
974 values[1] = make_number (s.st_nlink); | 974 values[1] = make_number (s.st_nlink); |
975 /* When make_fixnum_or_float is called below with types that are | 975 /* When make_fixnum_or_float is called below with types that are |
976 shorter than an int (e.g., `short'), GCC whines about comparison | 976 shorter than an int (e.g., `short'), GCC whines about comparison |
977 being always false due to limited range of data type. Fix by | 977 being always false due to limited range of data type. Fix by |
978 copying s.st_uid and s.st_gid into int variables. */ | 978 copying s.st_uid and s.st_gid into int variables. */ |
979 #ifdef WINDOWSNT | |
980 /* Windows uses signed short for the uid and gid in the stat structure, | |
981 but we use an int for getuid (limited to the range 0-60000). | |
982 So users with uid > 32767 need their uid patched back here. */ | |
983 uid = (unsigned short) s.st_uid; | |
984 gid = (unsigned short) s.st_gid; | |
985 #else | |
979 uid = s.st_uid; | 986 uid = s.st_uid; |
980 gid = s.st_gid; | 987 gid = s.st_gid; |
988 #endif | |
981 if (NILP (id_format) || EQ (id_format, Qinteger)) | 989 if (NILP (id_format) || EQ (id_format, Qinteger)) |
982 { | 990 { |
983 values[2] = make_fixnum_or_float (uid); | 991 values[2] = make_fixnum_or_float (uid); |
984 values[3] = make_fixnum_or_float (gid); | 992 values[3] = make_fixnum_or_float (gid); |
985 } | 993 } |