commit 897e557ce350a43ec88e042a65c92c6b364e2db3
parent 81bee1f5fd8a9dc027fa93fb5d55c29cd489f91e
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 5 Apr 2019 10:45:22 +0200
tweaks: rename a variable, to be more distinct and more descriptive
Diffstat:
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/search.c b/src/search.c
@@ -934,8 +934,8 @@ void do_find_bracket(void)
/* The length of wanted_ch in bytes. */
char bracket_set[MAXCHARLEN * 2 + 1];
/* The pair of characters in ch and wanted_ch. */
- size_t matchhalf;
- /* The number of bytes in the first half of matchbrackets. */
+ size_t halfway = 0;
+ /* The index in matchbrackets where the closing brackets start. */
size_t mbmatchhalf;
/* Half the number of characters in matchbrackets. */
size_t count = 1;
@@ -956,16 +956,15 @@ void do_find_bracket(void)
current_save = openfile->current;
current_x_save = openfile->current_x;
- matchhalf = 0;
mbmatchhalf = mbstrlen(matchbrackets) / 2;
/* Find the halfway point in matchbrackets, where the closing ones start. */
for (size_t i = 0; i < mbmatchhalf; i++)
- matchhalf += parse_mbchar(matchbrackets + matchhalf, NULL, NULL);
+ halfway += parse_mbchar(matchbrackets + halfway, NULL, NULL);
/* When on a closing bracket, we have to search backwards for a matching
* opening bracket; otherwise, forward for a matching closing bracket. */
- reverse = ((ch - matchbrackets) >= matchhalf);
+ reverse = (ch >= (matchbrackets + halfway));
/* If we're on an opening bracket, set wanted_ch to the character
* that's mbmatchhalf characters after ch. If we're on a closing