diff options
| author | Jason Rumney | 2002-11-27 23:51:02 +0000 |
|---|---|---|
| committer | Jason Rumney | 2002-11-27 23:51:02 +0000 |
| commit | 4bc12672406fab145035c2c24fc0cac8caf5844b (patch) | |
| tree | ce5abe11a7b8e26bc11c5a1ea282a6a8003b9d85 /src | |
| parent | 11d300dba0c28dad55a14b42b96d7aee32f5bd5d (diff) | |
| download | emacs-4bc12672406fab145035c2c24fc0cac8caf5844b.tar.gz emacs-4bc12672406fab145035c2c24fc0cac8caf5844b.zip | |
(Ffile_attributes): Don't return negative file sizes for
files bigger than 2Gb when off_t is 32 bit.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dired.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dired.c b/src/dired.c index 692d193c5ae..7b8a3dca552 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -940,6 +940,11 @@ If file does not exist, returns nil. */) | |||
| 940 | /* If the size is out of range for an integer, return a float. */ | 940 | /* If the size is out of range for an integer, return a float. */ |
| 941 | if (XINT (values[7]) != s.st_size) | 941 | if (XINT (values[7]) != s.st_size) |
| 942 | values[7] = make_float ((double)s.st_size); | 942 | values[7] = make_float ((double)s.st_size); |
| 943 | /* If the size is negative, and its type is long, convert it back to | ||
| 944 | positive. */ | ||
| 945 | if (s.st_size < 0 && sizeof (s.st_size) == sizeof (long)) | ||
| 946 | values[7] = make_float ((double) ((unsigned long) s.st_size)); | ||
| 947 | |||
| 943 | filemodestring (&s, modes); | 948 | filemodestring (&s, modes); |
| 944 | values[8] = make_string (modes, 10); | 949 | values[8] = make_string (modes, 10); |
| 945 | #if defined (BSD4_2) || defined (BSD4_3) /* file gid will be dir gid */ | 950 | #if defined (BSD4_2) || defined (BSD4_3) /* file gid will be dir gid */ |