commit 4c075f377159caa42be09690d5a5a183c5a78e5f
parent 0ccdaff9609ea198737b8aed408729d17b61b20c
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Sat, 16 Apr 2016 11:32:37 +0200
tabbing: rename four variables, snipping a redundant part
Diffstat:
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -2833,31 +2833,30 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool
char *mzero;
const char *lastslash = revstrstr(buf, "/", buf + *place);
size_t lastslash_len = (lastslash == NULL) ? 0 : lastslash - buf + 1;
- char *match1_mb = charalloc(mb_cur_max());
- char *match2_mb = charalloc(mb_cur_max());
- int match1_mb_len, match2_mb_len;
+ char *match1 = charalloc(mb_cur_max());
+ char *match2 = charalloc(mb_cur_max());
+ int match1_len, match2_len;
/* Get the number of characters that all matches have in common. */
while (TRUE) {
- match1_mb_len = parse_mbchar(matches[0] + common_len,
- match1_mb, NULL);
+ match1_len = parse_mbchar(matches[0] + common_len, match1, NULL);
for (match = 1; match < num_matches; match++) {
- match2_mb_len = parse_mbchar(matches[match] +
- common_len, match2_mb, NULL);
- if (match1_mb_len != match2_mb_len ||
- strncmp(match1_mb, match2_mb, match2_mb_len) != 0)
+ match2_len = parse_mbchar(matches[match] + common_len,
+ match2, NULL);
+ if (match1_len != match2_len ||
+ strncmp(match1, match2, match2_len) != 0)
break;
}
if (match < num_matches || matches[0][common_len] == '\0')
break;
- common_len += match1_mb_len;
+ common_len += match1_len;
}
- free(match1_mb);
- free(match2_mb);
+ free(match1);
+ free(match2);
mzero = charalloc(lastslash_len + common_len + 1);