commit 2458b295d926230e3008a509871fc03c50f02a9c
parent a4e92c8ad6051f58db33788306e7877934bfe230
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Fri, 30 Jun 2006 14:21:29 +0000
fix breakage
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3705 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git 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);