diff options
Diffstat (limited to 'src/dired.c')
| -rw-r--r-- | src/dired.c | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/src/dired.c b/src/dired.c index 1e587353f6d..a95882060fb 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -900,11 +900,10 @@ Elements of the attribute list are: | |||
| 900 | This is a floating point number if the size is too large for an integer. | 900 | This is a floating point number if the size is too large for an integer. |
| 901 | 8. File modes, as a string of ten letters or dashes as in ls -l. | 901 | 8. File modes, as a string of ten letters or dashes as in ls -l. |
| 902 | 9. t if file's gid would change if file were deleted and recreated. | 902 | 9. t if file's gid would change if file were deleted and recreated. |
| 903 | 10. inode number. If inode number is larger than what Emacs integer | 903 | 10. inode number. If it is larger than what an Emacs integer can hold, |
| 904 | can hold, but still fits into a 32-bit number, this is a cons cell | 904 | this is of the form (HIGH . LOW): first the high bits, then the low 16 bits. |
| 905 | containing two integers: first the high part, then the low 16 bits. | 905 | If even HIGH is too large for an Emacs integer, this is instead of the form |
| 906 | If the inode number is wider than 32 bits, this is of the form | 906 | (HIGH MIDDLE . LOW): first the high bits, then the middle 24 bits, |
| 907 | (HIGH MIDDLE . LOW): first the high 24 bits, then middle 24 bits, | ||
| 908 | and finally the low 16 bits. | 907 | and finally the low 16 bits. |
| 909 | 11. Filesystem device number. If it is larger than what the Emacs | 908 | 11. Filesystem device number. If it is larger than what the Emacs |
| 910 | integer can hold, this is a cons cell, similar to the inode number. | 909 | integer can hold, this is a cons cell, similar to the inode number. |
| @@ -998,34 +997,8 @@ so last access time will always be midnight of that day. */) | |||
| 998 | #else /* file gid will be egid */ | 997 | #else /* file gid will be egid */ |
| 999 | values[9] = (s.st_gid != getegid ()) ? Qt : Qnil; | 998 | values[9] = (s.st_gid != getegid ()) ? Qt : Qnil; |
| 1000 | #endif /* not BSD4_2 */ | 999 | #endif /* not BSD4_2 */ |
| 1001 | if (!FIXNUM_OVERFLOW_P (s.st_ino)) | 1000 | values[10] = INTEGER_TO_CONS (s.st_ino); |
| 1002 | /* Keep the most common cases as integers. */ | 1001 | values[11] = INTEGER_TO_CONS (s.st_dev); |
| 1003 | values[10] = make_number (s.st_ino); | ||
| 1004 | else if (!FIXNUM_OVERFLOW_P (s.st_ino >> 16)) | ||
| 1005 | /* To allow inode numbers larger than VALBITS, separate the bottom | ||
| 1006 | 16 bits. */ | ||
| 1007 | values[10] = Fcons (make_number ((EMACS_INT)(s.st_ino >> 16)), | ||
| 1008 | make_number ((EMACS_INT)(s.st_ino & 0xffff))); | ||
| 1009 | else | ||
| 1010 | { | ||
| 1011 | /* To allow inode numbers beyond 32 bits, separate into 2 24-bit | ||
| 1012 | high parts and a 16-bit bottom part. | ||
| 1013 | The code on the next line avoids a compiler warning on | ||
| 1014 | systems where st_ino is 32 bit wide. (bug#766). */ | ||
| 1015 | EMACS_INT high_ino = s.st_ino >> 31 >> 1; | ||
| 1016 | |||
| 1017 | values[10] = Fcons (make_number (high_ino >> 8), | ||
| 1018 | Fcons (make_number (((high_ino & 0xff) << 16) | ||
| 1019 | + (s.st_ino >> 16 & 0xffff)), | ||
| 1020 | make_number (s.st_ino & 0xffff))); | ||
| 1021 | } | ||
| 1022 | |||
| 1023 | /* Likewise for device. */ | ||
| 1024 | if (FIXNUM_OVERFLOW_P (s.st_dev)) | ||
| 1025 | values[11] = Fcons (make_number (s.st_dev >> 16), | ||
| 1026 | make_number (s.st_dev & 0xffff)); | ||
| 1027 | else | ||
| 1028 | values[11] = make_number (s.st_dev); | ||
| 1029 | 1002 | ||
| 1030 | return Flist (sizeof(values) / sizeof(values[0]), values); | 1003 | return Flist (sizeof(values) / sizeof(values[0]), values); |
| 1031 | } | 1004 | } |