From 42e0f52d981577b1a7b2f6cec844b59971fc0648 Mon Sep 17 00:00:00 2001 From: dborth Date: Tue, 7 Jul 2009 02:27:07 +0000 Subject: [PATCH] don't change dir names for display --- source/ngc/fileop.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/ngc/fileop.cpp b/source/ngc/fileop.cpp index 9686f46..b49dffd 100644 --- a/source/ngc/fileop.cpp +++ b/source/ngc/fileop.cpp @@ -383,23 +383,25 @@ ParseDirectory(int method) { browserList = newBrowserList; } + memset(&(browserList[entryNum]), 0, sizeof(BROWSERENTRY)); // clear the new entry strncpy(browserList[entryNum].filename, filename, MAXJOLIET); + browserList[entryNum].length = filestat.st_size; + browserList[entryNum].mtime = filestat.st_mtime; + browserList[entryNum].isdir = (filestat.st_mode & _IFDIR) == 0 ? 0 : 1; // flag this as a dir - if(strcmp(filename,"..") == 0) + if(browserList[entryNum].isdir) { - sprintf(browserList[entryNum].displayname, "Up One Level"); + if(strcmp(filename, "..") == 0) + sprintf(browserList[entryNum].displayname, "Up One Level"); + else + strncpy(browserList[entryNum].displayname, browserList[entryNum].filename, MAXJOLIET); } else { StripExt(browserList[entryNum].displayname, browserList[entryNum].filename); // hide file extension } - - browserList[entryNum].length = filestat.st_size; - browserList[entryNum].mtime = filestat.st_mtime; - browserList[entryNum].isdir = (filestat.st_mode & _IFDIR) == 0 ? 0 : 1; // flag this as a dir - entryNum++; } }