get_shortcut(browser_list, kbinput, meta_key, func_key);
/* Pico compatibility. */
- if (*meta_key == FALSE) {
+ if (!*meta_key) {
switch (*kbinput) {
case ' ':
*kbinput = NANO_NEXTPAGE_KEY;
fileptr->data[buf_len - 1] = '\0';
#endif
- if (*first_line_ins == TRUE) {
+ if (*first_line_ins) {
/* Special case: We're inserting with the cursor on the first
* line. */
fileptr->prev = NULL;
fileptr->next = openfile->fileage;
fileptr->lineno = 1;
- if (*first_line_ins == TRUE) {
+ if (*first_line_ins) {
*first_line_ins = FALSE;
/* If we're inserting into the first line of the file, then
* we want to make sure that our edit buffer stays on the
assert(common_len > *place);
}
- if (num_matches > 1 && (common_len != *place ||
- *lastwastab == FALSE))
+ if (num_matches > 1 && (common_len != *place || !*lastwastab))
beep();
/* If there is more of a match to display on the statusbar, show
*place + 1);
strncpy(buf, mzero, common_len);
*place = common_len;
- } else if (*lastwastab == FALSE || num_matches < 2)
+ } else if (!*lastwastab || num_matches < 2)
*lastwastab = TRUE;
else {
int longest_name = 0, columns, editline = 0;
/* Only refresh the edit window if we don't have a list of filename
* matches on it. */
- if (*list == FALSE)
+ if (!*list)
refresh_func();
/* Enable el cursor. */
{
get_shortcut(help_list, kbinput, meta_key, func_key);
- if (*meta_key == FALSE) {
+ if (!*meta_key) {
switch (*kbinput) {
/* For consistency with the file browser. */
case ' ':
if (allow_funcs) {
/* If we got a mouse click and it was on a shortcut, read in the
* shortcut character. */
- if (*func_key == TRUE && input == KEY_MOUSE) {
+ if (*func_key && input == KEY_MOUSE) {
if (do_mouse())
input = get_kbinput(edit, meta_key, func_key);
else {
/* If we got a non-high-bit control key, a meta key sequence, or a
* function key, and it's not a shortcut or toggle, throw it out. */
- if (*s_or_t == FALSE) {
- if (is_ascii_cntrl_char(input) || *meta_key == TRUE ||
- *func_key == TRUE) {
+ if (!*s_or_t) {
+ if (is_ascii_cntrl_char(input) || *meta_key || *func_key) {
statusbar(_("Unknown Command"));
beep();
*meta_key = FALSE;
* it's a normal text character. Display the warning if we're
* in view mode, or add the character to the input buffer if
* we're not. */
- if (input != ERR && *s_or_t == FALSE) {
+ if (input != ERR && !*s_or_t) {
if (ISSET(VIEW_MODE))
print_view_warning();
else {
* output all the characters in the input buffer if it isn't
* empty. Note that it should be empty if we're in view
* mode. */
- if (*s_or_t == TRUE || get_key_buffer_len() == 0) {
+ if (*s_or_t || get_key_buffer_len() == 0) {
#ifndef DISABLE_WRAPPING
/* If we got a shortcut or toggle, and it's not the shortcut
* for verbatim input, turn off prepending of wrapped
* text. */
- if (*s_or_t == TRUE && (!have_shortcut || s == NULL ||
- s->func != do_verbatim_input))
+ if (*s_or_t && (!have_shortcut || s == NULL || s->func !=
+ do_verbatim_input))
wrap_reset();
#endif
if (allow_funcs) {
/* If we got a mouse click and it was on a shortcut, read in the
* shortcut character. */
- if (*func_key == TRUE && input == KEY_MOUSE) {
+ if (*func_key && input == KEY_MOUSE) {
if (do_statusbar_mouse())
input = get_kbinput(bottomwin, meta_key, func_key);
else {
#ifndef NANO_TINY
input == NANO_NEXTWORD_KEY ||
#endif
- (*meta_key == TRUE && (
+ (*meta_key && (
#ifndef NANO_TINY
input == NANO_PREVWORD_KEY || input == NANO_BRACKET_KEY ||
#endif
/* If we got a non-high-bit control key, a meta key sequence, or a
* function key, and it's not a shortcut or toggle, throw it out. */
- if (*s_or_t == FALSE) {
- if (is_ascii_cntrl_char(input) || *meta_key == TRUE ||
- *func_key == TRUE) {
+ if (!*s_or_t) {
+ if (is_ascii_cntrl_char(input) || *meta_key || *func_key) {
beep();
*meta_key = FALSE;
*func_key = FALSE;
* it's a normal text character. Display the warning if we're
* in view mode, or add the character to the input buffer if
* we're not. */
- if (input != ERR && *s_or_t == FALSE) {
+ if (input != ERR && !*s_or_t) {
/* If we're using restricted mode, the filename isn't blank,
* and we're at the "Write File" prompt, disable text
* input. */
/* If we got a shortcut, or if there aren't any other characters
* waiting after the one we read in, we need to display all the
* characters in the input buffer if it isn't empty. */
- if (*s_or_t == TRUE || get_key_buffer_len() == 0) {
+ if (*s_or_t || get_key_buffer_len() == 0) {
if (kbinput != NULL) {
/* Display all the characters in the input buffer at
* once, filtering out control characters. */
do_statusbar_next_word(FALSE);
break;
case NANO_PREVWORD_KEY:
- if (*meta_key == TRUE)
+ if (*meta_key)
do_statusbar_prev_word(FALSE);
break;
#endif
break;
#ifndef NANO_TINY
case NANO_BRACKET_KEY:
- if (*meta_key == TRUE)
+ if (*meta_key)
do_statusbar_find_bracket();
break;
#endif
case NANO_VERBATIM_KEY:
- if (*meta_key == TRUE) {
+ if (*meta_key) {
/* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File"
* prompt, disable verbatim input. */
}
#ifdef DEBUG
- fprintf(stderr, "parse_kbinput(): kbinput = %d, meta_key = %s, func_key = %s, escapes = %d, byte_digits = %d, retval = %d\n", *kbinput, (*meta_key == TRUE) ? "TRUE" : "FALSE", (*func_key == TRUE) ? "TRUE" : "FALSE", escapes, byte_digits, retval);
+ fprintf(stderr, "parse_kbinput(): kbinput = %d, meta_key = %s, func_key = %s, escapes = %d, byte_digits = %d, retval = %d\n", *kbinput, *meta_key ? "TRUE" : "FALSE", *func_key ? "TRUE" : "FALSE", escapes, byte_digits, retval);
#endif
/* Return the result. */
}
#ifdef DEBUG
- fprintf(stderr, "get_escape_seq_kbinput(): retval = %d, ignore_seq = %s\n", retval, (*ignore_seq == TRUE) ? "TRUE" : "FALSE");
+ fprintf(stderr, "get_escape_seq_kbinput(): retval = %d, ignore_seq = %s\n", retval, *ignore_seq ? "TRUE" : "FALSE");
#endif
return retval;
free(seq);
#ifdef DEBUG
- fprintf(stderr, "parse_escape_seq_kbinput(): kbinput = %d, ignore_seq = %s, seq_len = %lu, retval = %d\n", kbinput, (*ignore_seq == TRUE) ? "TRUE" : "FALSE", (unsigned long)seq_len, retval);
+ fprintf(stderr, "parse_escape_seq_kbinput(): kbinput = %d, ignore_seq = %s, seq_len = %lu, retval = %d\n", kbinput, *ignore_seq ? "TRUE" : "FALSE", (unsigned long)seq_len, retval);
#endif
return retval;
size_t slen = length_of_list(s_list);
#ifdef DEBUG
- fprintf(stderr, "get_shortcut(): kbinput = %d, meta_key = %s, func_key = %s\n", *kbinput, (*meta_key == TRUE) ? "TRUE" : "FALSE", (*func_key == TRUE) ? "TRUE" : "FALSE");
+ fprintf(stderr, "get_shortcut(): kbinput = %d, meta_key = %s, func_key = %s\n", *kbinput, *meta_key ? "TRUE" : "FALSE", *func_key ? "TRUE" : "FALSE");
#endif
/* Check for shortcuts. */
* shortcut list. */
if (*kbinput != NANO_NO_KEY && (*kbinput == s->ctrlval ||
- (*meta_key == TRUE && (*kbinput == s->metaval ||
- *kbinput == s->miscval)) || (*func_key == TRUE &&
- *kbinput == s->funcval))) {
+ (*meta_key && (*kbinput == s->metaval || *kbinput ==
+ s->miscval)) || (*func_key && *kbinput ==
+ s->funcval))) {
break;
}