nano

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

commit 93fa53c3e8913a081c7f0d3b3419eed2f17ee07c
parent eea3e1f0b2b48650d9cde491ad00eb44f12be7df
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 18 Mar 2022 11:36:10 +0100

tweaks: elide an unneeded call of strlen()

Diffstat:
Msrc/cut.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cut.c b/src/cut.c @@ -495,7 +495,7 @@ void do_snip(bool marked, bool until_eof, bool append) /* When not at the end of a line, move the rest of this line into * the cutbuffer. Otherwise, when not at the end of the buffer, * move just the "line separator" into the cutbuffer. */ - if (openfile->current_x < strlen(openfile->current->data)) + if (line->data[openfile->current_x] != '\0') extract_segment(line, openfile->current_x, line, strlen(line->data)); else if (openfile->current != openfile->filebot) { extract_segment(line, openfile->current_x, line->next, 0);