nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 9d6621afd017ba6ab5bfcdf0c7d1398a70ab07f2
parent cdd637d69fd9f0bfa05b017285ec20a1dfe8dc8f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 20 May 2018 20:56:36 +0200

tweaks: remove two superfluous checks, after making one of them so

Diffstat:
Msrc/text.c | 12++----------
1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/text.c b/src/text.c @@ -1922,9 +1922,6 @@ bool begpar(const filestruct *const line) { size_t quote_len, indent_len, temp_id_len; - if (line == NULL) - return FALSE; - /* Case 1). */ if (line == openfile->fileage) return TRUE; @@ -1955,12 +1952,7 @@ bool begpar(const filestruct *const line) /* Return TRUE when the given line is part of a paragraph. */ bool inpar(const filestruct *const line) { - size_t quote_len; - - if (line == NULL) - return FALSE; - - quote_len = quote_length(line->data); + size_t quote_len = quote_length(line->data); return (line->data[quote_len + indent_length(line->data + quote_len)] != '\0'); @@ -2076,7 +2068,7 @@ bool find_paragraph(size_t *const quote, size_t *const par) * paragraph, in which case we should move back to the last line * of the next paragraph. */ if (openfile->current_x == 0) { - if (!inpar(openfile->current->prev)) + if (!openfile->current->prev || !inpar(openfile->current->prev)) return FALSE; if (openfile->current != openfile->fileage) openfile->current = openfile->current->prev;