mirror of
https://github.com/digarok/gsplus.git
synced 2024-05-31 17:41:28 +00:00
unix host mli bug fixes
1. file/directory storage types were reversed 2. month was off-by-one.
This commit is contained in:
parent
a76d26a0ad
commit
b6406159bd
|
@ -126,7 +126,7 @@ void host_set_date_time(word32 ptr, time_t time) {
|
||||||
|
|
||||||
word16 tmp = 0;
|
word16 tmp = 0;
|
||||||
tmp |= (tm->tm_year % 100) << 9;
|
tmp |= (tm->tm_year % 100) << 9;
|
||||||
tmp |= tm->tm_mon << 5;
|
tmp |= (tm->tm_mon + 1) << 5;
|
||||||
tmp |= tm->tm_mday;
|
tmp |= tm->tm_mday;
|
||||||
|
|
||||||
set_memory16_c(ptr, tmp, 0);
|
set_memory16_c(ptr, tmp, 0);
|
||||||
|
@ -146,7 +146,7 @@ word32 host_convert_date_time(time_t time) {
|
||||||
|
|
||||||
word16 dd = 0;
|
word16 dd = 0;
|
||||||
dd |= (tm->tm_year % 100) << 9;
|
dd |= (tm->tm_year % 100) << 9;
|
||||||
dd |= tm->tm_mon << 5;
|
dd |= (tm->tm_mon + 1) << 5;
|
||||||
dd |= tm->tm_mday;
|
dd |= tm->tm_mday;
|
||||||
|
|
||||||
word16 tt = 0;
|
word16 tt = 0;
|
||||||
|
@ -503,10 +503,10 @@ unsigned host_storage_type(const char *path, word16 *error) {
|
||||||
*error = host_map_errno_path(errno, path);
|
*error = host_map_errno_path(errno, path);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (S_ISREG(st.st_mode)) {
|
if (S_ISDIR(st.st_mode)) {
|
||||||
return host_is_root(&st) ? 0x0f : directoryFile;
|
return host_is_root(&st) ? 0x0f : directoryFile;
|
||||||
}
|
}
|
||||||
if (S_ISDIR(st.st_mode)) return standardFile;
|
if (S_ISREG(st.st_mode)) return standardFile;
|
||||||
*error = badStoreType;
|
*error = badStoreType;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user