Remove two pointless calls of get_shortcut(), and adjust the comments.
* src/nano.c (do_toggle): When toggling softwrap, only the edit window
needs to be refreshed, not the entire screen.
+ * src/browser.c (do_browser): Remove superfluous abortion variable,
+ and place two comments better.
2014-06-22 Mark Majeres <mark@engine12.com>
* src/text.c (do_redo): When redoing a line join at the tail
char *retval = NULL;
int kbinput;
bool meta_key, func_key, old_const_update = ISSET(CONST_UPDATE);
- bool abort = FALSE;
- /* Whether we should abort the file browser. */
char *prev_dir = NULL;
/* The directory we were in, if any, before backing up via
* browsing to "..". */
titlebar(path);
- while (!abort) {
+ while (TRUE) {
struct stat st;
int i;
size_t fileline = selected / width;
continue;
}
- /* If we've successfully opened a file, we're done, so
- * get out. */
if (!S_ISDIR(st.st_mode)) {
+ /* We've successfully opened a file, we're done, so
+ * get out. */
retval = mallocstrcpy(NULL, filelist[selected]);
- abort = TRUE;
- continue;
- /* If we've successfully opened a directory, and it's
- * "..", save the current directory in prev_dir, so that
- * we can easily return to it by hitting Enter. */
+ break;
} else if (strcmp(tail(filelist[selected]), "..") == 0)
+ /* We've successfully opened the parent directory,
+ * save the current directory in prev_dir, so that
+ * we can easily return to it by hitting Enter. */
prev_dir = mallocstrcpy(NULL, striponedir(filelist[selected]));
dir = opendir(filelist[selected]);
/* Start over again with the new path value. */
goto change_browser_directory;
} else if (f->scfunc == do_exit) {
- /* Abort the file browser. */
- abort = TRUE;
+ /* Exit from the file browser. */
+ break;
}
}
titlebar(NULL);