From: David Lawrence Ramsey Date: Fri, 30 Jun 2006 07:26:14 +0000 (+0000) Subject: revert last changes, as the "Go to Directory" prompt can allow movement X-Git-Tag: v1.9.99pre1~160 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=0fd5d60477ee2f6a0da4136e6a4c03b59611928b;p=nano.git revert last changes, as the "Go to Directory" prompt can allow movement anywhere, so the error message won't make sense in some cases git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3701 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index a31cc226..94ab5ded 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,9 +16,6 @@ CVS code - - Remove unneeded call to blank_edit(). (DLR) - After entering "..", select the directory we were in before instead of the first filename in the list, as Pico does. (DLR) - - Display an error messsage on the statusbar if we try to move - up from "/" via the "Go to Directory" prompt, for consistency. - (DLR) browser_refresh() - Simplify. (DLR) - Fix problems where translated versions of "(dir)" could be diff --git a/src/browser.c b/src/browser.c index 00310e28..f9e48975 100644 --- a/src/browser.c +++ b/src/browser.c @@ -107,7 +107,6 @@ char *do_browser(char *path, DIR *dir) int i; size_t fileline; char *new_path; - size_t new_path_len; /* Compute the line number we're on now, so that we don't divide * by zero. */ @@ -243,25 +242,13 @@ char *do_browser(char *path, DIR *dir) ans = mallocstrcpy(ans, ""); new_path = real_dir_from_tilde(answer); - new_path_len = strlen(new_path) + 1; if (new_path[0] != '/') { - new_path = charealloc(new_path, new_path_len + - strlen(answer)); + new_path = charealloc(new_path, strlen(new_path) + + strlen(answer) + 1); sprintf(new_path, "%s%s", path, answer); } - 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 "/". */ - if (strcmp(new_path, "/..") == 0) { - statusbar(_("Can't move up a directory")); - beep(); - break; - } - #ifndef DISABLE_OPERATINGDIR if (check_operating_dir(new_path, FALSE)) { statusbar(