mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-29 09:13:01 +00:00
(file) Expand stat port to show longer file length than a short
This commit is contained in:
parent
6712c3eeb9
commit
2878639cd7
1 changed files with 6 additions and 6 deletions
|
@ -235,17 +235,17 @@ file_stat(UxnFile *c, char *p, Uint16 len)
|
||||||
if(c->outside_sandbox || !len)
|
if(c->outside_sandbox || !len)
|
||||||
return 0;
|
return 0;
|
||||||
if(stat(c->current_filename, &st))
|
if(stat(c->current_filename, &st))
|
||||||
for(i = 0; i < len && i < 4; i++)
|
for(i = 0; i < len; i++)
|
||||||
p[i] = '!';
|
p[i] = '!';
|
||||||
else if(S_ISDIR(st.st_mode))
|
else if(S_ISDIR(st.st_mode))
|
||||||
for(i = 0; i < len && i < 4; i++)
|
for(i = 0; i < len; i++)
|
||||||
p[i] = '-';
|
p[i] = '-';
|
||||||
else if(st.st_size >= 0x10000)
|
else if(st.st_size >= 1 << (len << 2))
|
||||||
for(i = 0; i < len && i < 4; i++)
|
for(i = 0; i < len; i++)
|
||||||
p[i] = '?';
|
p[i] = '?';
|
||||||
else
|
else
|
||||||
for(i = 0, size = st.st_size; i < len && i < 4; i++, size <<= 4)
|
for(i = 0, size = st.st_size; i < len; i++)
|
||||||
p[i] = inthex(size >> 0xc);
|
p[i] = inthex(size >> ((len - i - 1) << 2));
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue