diff options
author | Denis Vlasenko | 2006-09-17 16:28:10 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-09-17 16:28:10 +0000 |
commit | 9213a9e0f2d8fd638ecd02e2628d96dd5c7d233e (patch) | |
tree | 94c3c0678d1349497abe2db6004e9331e50f6d37 /miscutils/less.c | |
parent | a6127aacef047ed7661722705b052811fbe7f467 (diff) | |
download | busybox-9213a9e0f2d8fd638ecd02e2628d96dd5c7d233e.zip busybox-9213a9e0f2d8fd638ecd02e2628d96dd5c7d233e.tar.gz |
whitespace cleanup
Diffstat (limited to 'miscutils/less.c')
-rw-r--r-- | miscutils/less.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/miscutils/less.c b/miscutils/less.c index c13d7b8..bde2a45 100644 --- a/miscutils/less.c +++ b/miscutils/less.c @@ -610,26 +610,26 @@ static char *process_regex_on_line(char *line, regex_t *pattern, int action) match_found = 0; match_status = regexec(pattern, line2, 1, &match_structs, 0); - + while (match_status == 0) { if (match_found == 0) match_found = 1; - + if (action) { - growline = xasprintf("%s%.*s%s%.*s%s", growline, match_structs.rm_so, line2, HIGHLIGHT, match_structs.rm_eo - match_structs.rm_so, line2 + match_structs.rm_so, NORMAL); + growline = xasprintf("%s%.*s%s%.*s%s", growline, match_structs.rm_so, line2, HIGHLIGHT, match_structs.rm_eo - match_structs.rm_so, line2 + match_structs.rm_so, NORMAL); } else { growline = xasprintf("%s%.*s%.*s", growline, match_structs.rm_so - 4, line2, match_structs.rm_eo - match_structs.rm_so, line2 + match_structs.rm_so); } - + line2 += match_structs.rm_eo; match_status = regexec(pattern, line2, 1, &match_structs, REG_NOTBOL); } - + growline = xasprintf("%s%s", growline, line2); - + return (match_found ? growline : line); - + free(growline); free(line2); } @@ -656,7 +656,7 @@ static void regex_process(void) putchar((match_backwards) ? '?' : '/'); uncomp_regex[0] = 0; fgets(uncomp_regex, sizeof(uncomp_regex), inp); - + if (strlen(uncomp_regex) == 1) { if (num_matches) goto_match(match_backwards ? match_pos - 1 : match_pos + 1); @@ -665,7 +665,7 @@ static void regex_process(void) return; } uncomp_regex[strlen(uncomp_regex) - 1] = '\0'; - + /* Compile the regex and check for errors */ xregcomp(&pattern, uncomp_regex, 0); @@ -677,7 +677,7 @@ static void regex_process(void) } } old_pattern = pattern; - + /* Reset variables */ match_lines = xrealloc(match_lines, sizeof(int)); match_lines[0] = -1; @@ -694,7 +694,7 @@ static void regex_process(void) j++; } } - + num_matches = j; if ((match_lines[0] != -1) && (num_flines > height - 2)) { if (match_backwards) { |