fix: fix ramdisk readdir inconsistency.
This commit is contained in:
@@ -14,9 +14,8 @@
|
||||
// App Manifest Scanning
|
||||
// ============================================================================
|
||||
|
||||
// Extract the basename from a readdir entry.
|
||||
// readdir returns full paths from drive root (e.g. "apps/doom/") —
|
||||
// strip the directory prefix and any trailing slash to get just "doom".
|
||||
// Extract the basename from a readdir entry, tolerating both current
|
||||
// direct-child names and paths returned by older ramdisk kernels.
|
||||
static void extract_basename(char* out, int outSz, const char* entry) {
|
||||
// Strip trailing slash
|
||||
int len = montauk::slen(entry);
|
||||
@@ -89,7 +88,7 @@ void desktop_scan_apps(DesktopState* ds) {
|
||||
scanned += got;
|
||||
|
||||
for (int i = 0; i < got; i++) {
|
||||
// readdir returns paths like "apps/doom/" — extract just "doom"
|
||||
// Strip the directory marker and tolerate old root-relative entries.
|
||||
char dirname[64];
|
||||
extract_basename(dirname, sizeof(dirname), entries[i]);
|
||||
if (dirname[0] == '\0') continue;
|
||||
|
||||
Reference in New Issue
Block a user