From 2458b295d926230e3008a509871fc03c50f02a9c Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Fri, 30 Jun 2006 14:21:29 +0000 Subject: [PATCH] fix breakage git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3705 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- src/browser.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/browser.c b/src/browser.c index 6caa4764..47767888 100644 --- a/src/browser.c +++ b/src/browser.c @@ -333,7 +333,8 @@ char *do_browser(char *path, DIR *dir) } else if (strcmp(tail(filelist[selected]), "..") == 0) { prev_dir = mallocstrcpy(NULL, filelist[selected]); - prev_dir = striponedir(prev_dir); + prev_dir = mallocstrassn(prev_dir, + striponedir(prev_dir)); } dir = opendir(filelist[selected]); @@ -401,7 +402,8 @@ char *do_browse_from(const char *inpath) * at all. If so, we'll just pass the current directory to * do_browser(). */ if (stat(path, &st) == -1 || !S_ISDIR(st.st_mode)) { - path = striponedir(path); + path = mallocstrassn(path, striponedir(path)); + if (stat(path, &st) == -1 || !S_ISDIR(st.st_mode)) { free(path); -- 2.39.5