nano

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

commit 914921887e358d9777300a8f885b633bcf0772c4
parent 64a8f1930eeedc3d897172f65d4c582482831122
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sat, 11 Sep 2021 11:09:56 +0200

tweaks: rename a variable, to make more sense

Diffstat:
Msrc/search.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/search.c b/src/search.c @@ -606,15 +606,15 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only, } if (choice == 1 || replaceall) { /* Yes, replace it. */ - char *copy; size_t length_change; + char *altered; #ifndef NANO_TINY add_undo(REPLACE, NULL); #endif - copy = replace_line(needle); + altered = replace_line(needle); - length_change = strlen(copy) - strlen(openfile->current->data); + length_change = strlen(altered) - strlen(openfile->current->data); #ifndef NANO_TINY /* If the mark was on and it was located after the cursor, @@ -655,9 +655,9 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only, openfile->current_x += match_len + length_change; /* Update the file size, and put the changed line into place. */ - openfile->totsize += mbstrlen(copy) - mbstrlen(openfile->current->data); + openfile->totsize += mbstrlen(altered) - mbstrlen(openfile->current->data); free(openfile->current->data); - openfile->current->data = copy; + openfile->current->data = altered; set_modified(); as_an_at = TRUE;