more miscellaneous minor fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2671 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey 2005-06-15 07:18:30 +00:00
parent ab41ab9246
commit 9c06f34ef9
4 changed files with 9 additions and 10 deletions

View File

@ -126,6 +126,8 @@ CVS code -
- When displaying "(dir)" in the available screen space, make
sure that the string it's stored in is always null-terminated.
(DLR)
- Rename variable selectedbackup to old_selected, for
consistency. (DLR)
save_history()
- Properly save history when in view mode. (DLR)
- global.c:

View File

@ -118,8 +118,7 @@ bool is_cntrl_char(int c)
* set. */
bool is_cntrl_wchar(wint_t wc)
{
return (-128 <= wc && wc < -96) || (0 <= wc && wc < 32) ||
(127 <= wc && wc < 160);
return (0 <= wc && wc < 32) || (127 <= wc && wc < 160);
}
#endif

View File

@ -2397,25 +2397,23 @@ char **browser_init(const char *path, int *longest, size_t *numents, DIR
{
const struct dirent *nextdir;
char **filelist;
size_t i, path_len;
size_t i = 0, path_len;
assert(dir != NULL);
*longest = 0;
i = 0;
while ((nextdir = readdir(dir)) != NULL) {
size_t dlen;
/* Don't show the . entry. */
/* Don't show the "." entry. */
if (strcmp(nextdir->d_name, ".") == 0)
continue;
i++;
dlen = strlenpt(nextdir->d_name);
if (dlen > *longest)
*longest = dlen;
*longest = (dlen > COLS - 1) ? COLS - 1 : dlen;
}
*numents = i;
@ -2527,7 +2525,7 @@ char *do_browser(char *path, DIR *dir)
/* If we clicked in the edit window, we probably clicked
* on a file. */
if (wenclose(edit, mevent.y, mevent.x)) {
int selectedbackup = selected;
int old_selected = selected;
mevent.y -= 2;
@ -2547,7 +2545,7 @@ char *do_browser(char *path, DIR *dir)
* this name! */
if (selected > numents - 1)
selected = numents - 1;
else if (selectedbackup == selected)
else if (old_selected == selected)
/* Put back the 'select' key. */
unget_kbinput('s', FALSE, FALSE);
} else {

View File

@ -1809,7 +1809,7 @@ bool do_wrap(filestruct *line)
next_line = line->next->data;
next_line_len = strlen(next_line);
if ((after_break_len + next_line_len) <= fill) {
if (after_break_len + next_line_len <= fill) {
wrapping = TRUE;
new_line_len += next_line_len;
}