Use atoll()/atof() instead of atol() for st_size to show file sizes > 2G.

This commit is contained in:
Andrew V. Samoilov 2004-08-30 18:36:58 +00:00
parent d16aa745e8
commit 562577c0d4
2 changed files with 12 additions and 5 deletions

View File

@ -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)

View File

@ -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