From: David Lawrence Ramsey Date: Fri, 30 Jun 2006 14:21:29 +0000 (+0000) Subject: fix breakage X-Git-Tag: v1.9.99pre1~156 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=2458b295d926230e3008a509871fc03c50f02a9c;p=nano.git fix breakage git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3705 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- 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);