nano

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

commit 3357712928eacef97f8aa404a7949dafc6dec22a
parent 0e59c12af41c6febbc3297281b25954310d0e479
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue,  3 Mar 2020 12:05:43 +0100

tweaks: remove two superfluous conditions

The 'ptr' variable can never be NULL in those places -- whenever it
becomes NULL, the routine returns immediately.

Diffstat:
Msrc/rcfile.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/rcfile.c b/src/rcfile.c @@ -1049,7 +1049,7 @@ void parse_rule(char *ptr, int rex_flags) return; } - while (ptr != NULL && *ptr != '\0') { + while (*ptr != '\0') { colortype *newcolor = NULL; /* Container for a regex (or regex pair) and the color it paints. */ bool goodstart; @@ -1102,7 +1102,7 @@ void parse_rule(char *ptr, int rex_flags) if (!expectend) continue; - if (ptr == NULL || strncmp(ptr, "end=", 4) != 0) { + if (strncmp(ptr, "end=", 4) != 0) { jot_error(N_("\"start=\" requires a corresponding \"end=\"")); return; }