tweaks: rename a variable, to make more sense

master
Benno Schulenberg 2021-09-11 11:09:56 +02:00
parent 64a8f1930e
commit 914921887e
1 changed files with 5 additions and 5 deletions

View File

@ -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;