Commit 9c06f34e authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

more miscellaneous minor fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2671 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 9 additions and 10 deletions
+9 -10
...@@ -126,6 +126,8 @@ CVS code - ...@@ -126,6 +126,8 @@ CVS code -
- When displaying "(dir)" in the available screen space, make - When displaying "(dir)" in the available screen space, make
sure that the string it's stored in is always null-terminated. sure that the string it's stored in is always null-terminated.
(DLR) (DLR)
- Rename variable selectedbackup to old_selected, for
consistency. (DLR)
save_history() save_history()
- Properly save history when in view mode. (DLR) - Properly save history when in view mode. (DLR)
- global.c: - global.c:
......
...@@ -118,8 +118,7 @@ bool is_cntrl_char(int c) ...@@ -118,8 +118,7 @@ bool is_cntrl_char(int c)
* set. */ * set. */
bool is_cntrl_wchar(wint_t wc) bool is_cntrl_wchar(wint_t wc)
{ {
return (-128 <= wc && wc < -96) || (0 <= wc && wc < 32) || return (0 <= wc && wc < 32) || (127 <= wc && wc < 160);
(127 <= wc && wc < 160);
} }
#endif #endif
......
...@@ -2397,25 +2397,23 @@ char **browser_init(const char *path, int *longest, size_t *numents, DIR ...@@ -2397,25 +2397,23 @@ char **browser_init(const char *path, int *longest, size_t *numents, DIR
{ {
const struct dirent *nextdir; const struct dirent *nextdir;
char **filelist; char **filelist;
size_t i, path_len; size_t i = 0, path_len;
assert(dir != NULL); assert(dir != NULL);
*longest = 0; *longest = 0;
i = 0;
while ((nextdir = readdir(dir)) != NULL) { while ((nextdir = readdir(dir)) != NULL) {
size_t dlen; size_t dlen;
/* Don't show the . entry. */ /* Don't show the "." entry. */
if (strcmp(nextdir->d_name, ".") == 0) if (strcmp(nextdir->d_name, ".") == 0)
continue; continue;
i++; i++;
dlen = strlenpt(nextdir->d_name); dlen = strlenpt(nextdir->d_name);
if (dlen > *longest) if (dlen > *longest)
*longest = dlen; *longest = (dlen > COLS - 1) ? COLS - 1 : dlen;
} }
*numents = i; *numents = i;
...@@ -2527,7 +2525,7 @@ char *do_browser(char *path, DIR *dir) ...@@ -2527,7 +2525,7 @@ char *do_browser(char *path, DIR *dir)
/* If we clicked in the edit window, we probably clicked /* If we clicked in the edit window, we probably clicked
* on a file. */ * on a file. */
if (wenclose(edit, mevent.y, mevent.x)) { if (wenclose(edit, mevent.y, mevent.x)) {
int selectedbackup = selected; int old_selected = selected;
mevent.y -= 2; mevent.y -= 2;
...@@ -2547,7 +2545,7 @@ char *do_browser(char *path, DIR *dir) ...@@ -2547,7 +2545,7 @@ char *do_browser(char *path, DIR *dir)
* this name! */ * this name! */
if (selected > numents - 1) if (selected > numents - 1)
selected = numents - 1; selected = numents - 1;
else if (selectedbackup == selected) else if (old_selected == selected)
/* Put back the 'select' key. */ /* Put back the 'select' key. */
unget_kbinput('s', FALSE, FALSE); unget_kbinput('s', FALSE, FALSE);
} else { } else {
......
...@@ -1809,7 +1809,7 @@ bool do_wrap(filestruct *line) ...@@ -1809,7 +1809,7 @@ bool do_wrap(filestruct *line)
next_line = line->next->data; next_line = line->next->data;
next_line_len = strlen(next_line); next_line_len = strlen(next_line);
if ((after_break_len + next_line_len) <= fill) { if (after_break_len + next_line_len <= fill) {
wrapping = TRUE; wrapping = TRUE;
new_line_len += next_line_len; new_line_len += next_line_len;
} }
......
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