diff options
Diffstat (limited to 'frontend/common')
-rw-r--r-- | frontend/common/menu.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/frontend/common/menu.c b/frontend/common/menu.c index 22a66ea..aa76e43 100644 --- a/frontend/common/menu.c +++ b/frontend/common/menu.c @@ -872,9 +872,12 @@ rescan: {
int newlen;
char *p, *newdir;
- if (!(inp & PBTN_MOK)) continue;
+ if (!(inp & PBTN_MOK))
+ continue;
newlen = strlen(curr_path) + strlen(namelist[sel+1]->d_name) + 2;
newdir = malloc(newlen);
+ if (newdir == NULL)
+ break;
if (strcmp(namelist[sel+1]->d_name, "..") == 0) {
char *start = curr_path;
p = start + strlen(start) - 1;
@@ -920,6 +923,13 @@ rescan: free(namelist);
}
+ // restore curr_path
+ if (fname != NULL) {
+ n = strlen(curr_path);
+ if (curr_path + n + 1 == fname)
+ curr_path[n] = '/';
+ }
+
return ret;
}
|