From 1bd9ee68b03333894512373d14707d04951665af Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 18 Jan 2011 18:04:58 +0200 Subject: some frontend adjustments --- frontend/common/menu.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'frontend/common') 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; } -- cgit v1.2.3