mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-24 20:22:11 +03:00
Use atoll()/atof() instead of atol() for st_size to show file sizes > 2G.
This commit is contained in:
parent
d16aa745e8
commit
562577c0d4
11
vfs/fish.c
11
vfs/fish.c
@ -421,15 +421,18 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
|
||||
|
||||
switch(buffer[0]) {
|
||||
case ':': {
|
||||
/* char *c; */
|
||||
if (!strcmp(buffer+1, ".") || !strcmp(buffer+1, ".."))
|
||||
break; /* We'll do . and .. ourself */
|
||||
ent->name = g_strdup(buffer+1);
|
||||
/* if ((c=strchr(ent->name, ' ')))
|
||||
*c = 0; / * this is ugly, but we cannot handle " " in name */
|
||||
break;
|
||||
}
|
||||
case 'S': ST.st_size = atoi(buffer+1); break;
|
||||
case 'S':
|
||||
#ifdef HAVE_ATOLL
|
||||
ST.st_size = (off_t) atoll (buffer+1);
|
||||
#else
|
||||
ST.st_size = (off_t) atof (buffer+1);
|
||||
#endif
|
||||
break;
|
||||
case 'P': {
|
||||
int i;
|
||||
if ((i = vfs_parse_filetype(buffer[1])) ==-1)
|
||||
|
@ -769,7 +769,11 @@ vfs_parse_ls_lga (const char *p, struct stat *s, char **filename,
|
||||
if (!is_num (idx2))
|
||||
goto error;
|
||||
|
||||
s->st_size = (size_t) atol (columns[idx2]);
|
||||
#ifdef HAVE_ATOLL
|
||||
s->st_size = (off_t) atoll (columns[idx2]);
|
||||
#else
|
||||
s->st_size = (off_t) atof (columns[idx2]);
|
||||
#endif
|
||||
#ifdef HAVE_STRUCT_STAT_ST_RDEV
|
||||
s->st_rdev = 0;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user