Commit 780f1d3f authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

fix breakage

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3700 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 4 additions and 3 deletions
+4 -3
......@@ -246,12 +246,13 @@ char *do_browser(char *path, DIR *dir)
new_path_len = strlen(new_path) + 1;
if (new_path[0] != '/') {
new_path = charealloc(new_path, strlen(path) +
strlen(answer) + 1);
new_path = charealloc(new_path, new_path_len +
strlen(answer));
sprintf(new_path, "%s%s", path, answer);
}
if (new_path[new_path_len - 1] == '/')
if (new_path_len > 1 &&
new_path[new_path_len - 1] == '/')
null_at(&new_path, new_path_len - 1);
/* We can't move up from "/". */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment