Commit f8c33e86 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: reduce the scope of two variables

parent b6efea26
Showing with 4 additions and 4 deletions
+4 -4
...@@ -122,9 +122,6 @@ char *do_browser(char *path) ...@@ -122,9 +122,6 @@ char *do_browser(char *path)
titlebar(path); titlebar(path);
while (TRUE) { while (TRUE) {
struct stat st;
int i;
/* Make sure that the cursor is off. */ /* Make sure that the cursor is off. */
curs_set(0); curs_set(0);
lastmessage = HUSH; lastmessage = HUSH;
...@@ -235,7 +232,7 @@ char *do_browser(char *path) ...@@ -235,7 +232,7 @@ char *do_browser(char *path)
selected = filelist_len - 1; selected = filelist_len - 1;
} else if (func == goto_dir_void) { } else if (func == goto_dir_void) {
/* Ask for the directory to go to. */ /* Ask for the directory to go to. */
i = do_prompt(TRUE, int i = do_prompt(TRUE,
#ifndef DISABLE_TABCOMP #ifndef DISABLE_TABCOMP
FALSE, FALSE,
#endif #endif
...@@ -245,6 +242,7 @@ char *do_browser(char *path) ...@@ -245,6 +242,7 @@ char *do_browser(char *path)
#endif #endif
/* TRANSLATORS: This is a prompt. */ /* TRANSLATORS: This is a prompt. */
browser_refresh, _("Go To Directory")); browser_refresh, _("Go To Directory"));
/* If the directory begins with a newline (i.e. an /* If the directory begins with a newline (i.e. an
* encoded null), treat it as though it's blank. */ * encoded null), treat it as though it's blank. */
if (i < 0 || *answer == '\n') { if (i < 0 || *answer == '\n') {
...@@ -304,6 +302,8 @@ char *do_browser(char *path) ...@@ -304,6 +302,8 @@ char *do_browser(char *path)
if (selected < filelist_len - 1) if (selected < filelist_len - 1)
selected++; selected++;
} else if (func == do_enter) { } else if (func == do_enter) {
struct stat st;
/* We can't move up from "/". */ /* We can't move up from "/". */
if (strcmp(filelist[selected], "/..") == 0) { if (strcmp(filelist[selected], "/..") == 0) {
statusline(ALERT, _("Can't move up a directory")); statusline(ALERT, _("Can't move up a directory"));
......
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