From 914921887e358d9777300a8f885b633bcf0772c4 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 11 Sep 2021 11:09:56 +0200 Subject: [PATCH] tweaks: rename a variable, to make more sense --- src/search.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/search.c b/src/search.c index 3c413b9d..bd3ecabe 100644 --- 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;