aboutsummaryrefslogtreecommitdiff
path: root/miscutils/less.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-09-17 16:28:10 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-09-17 16:28:10 +0000
commit9213a9e0f2d8fd638ecd02e2628d96dd5c7d233e (patch)
tree94c3c0678d1349497abe2db6004e9331e50f6d37 /miscutils/less.c
parenta6127aacef047ed7661722705b052811fbe7f467 (diff)
downloadbusybox-w32-9213a9e0f2d8fd638ecd02e2628d96dd5c7d233e.tar.gz
busybox-w32-9213a9e0f2d8fd638ecd02e2628d96dd5c7d233e.tar.bz2
busybox-w32-9213a9e0f2d8fd638ecd02e2628d96dd5c7d233e.zip
whitespace cleanup
Diffstat (limited to 'miscutils/less.c')
-rw-r--r--miscutils/less.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/miscutils/less.c b/miscutils/less.c
index c13d7b8a2..bde2a4527 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)
610 610
611 match_found = 0; 611 match_found = 0;
612 match_status = regexec(pattern, line2, 1, &match_structs, 0); 612 match_status = regexec(pattern, line2, 1, &match_structs, 0);
613 613
614 while (match_status == 0) { 614 while (match_status == 0) {
615 if (match_found == 0) 615 if (match_found == 0)
616 match_found = 1; 616 match_found = 1;
617 617
618 if (action) { 618 if (action) {
619 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); 619 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);
620 } 620 }
621 else { 621 else {
622 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); 622 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);
623 } 623 }
624 624
625 line2 += match_structs.rm_eo; 625 line2 += match_structs.rm_eo;
626 match_status = regexec(pattern, line2, 1, &match_structs, REG_NOTBOL); 626 match_status = regexec(pattern, line2, 1, &match_structs, REG_NOTBOL);
627 } 627 }
628 628
629 growline = xasprintf("%s%s", growline, line2); 629 growline = xasprintf("%s%s", growline, line2);
630 630
631 return (match_found ? growline : line); 631 return (match_found ? growline : line);
632 632
633 free(growline); 633 free(growline);
634 free(line2); 634 free(line2);
635} 635}
@@ -656,7 +656,7 @@ static void regex_process(void)
656 putchar((match_backwards) ? '?' : '/'); 656 putchar((match_backwards) ? '?' : '/');
657 uncomp_regex[0] = 0; 657 uncomp_regex[0] = 0;
658 fgets(uncomp_regex, sizeof(uncomp_regex), inp); 658 fgets(uncomp_regex, sizeof(uncomp_regex), inp);
659 659
660 if (strlen(uncomp_regex) == 1) { 660 if (strlen(uncomp_regex) == 1) {
661 if (num_matches) 661 if (num_matches)
662 goto_match(match_backwards ? match_pos - 1 : match_pos + 1); 662 goto_match(match_backwards ? match_pos - 1 : match_pos + 1);
@@ -665,7 +665,7 @@ static void regex_process(void)
665 return; 665 return;
666 } 666 }
667 uncomp_regex[strlen(uncomp_regex) - 1] = '\0'; 667 uncomp_regex[strlen(uncomp_regex) - 1] = '\0';
668 668
669 /* Compile the regex and check for errors */ 669 /* Compile the regex and check for errors */
670 xregcomp(&pattern, uncomp_regex, 0); 670 xregcomp(&pattern, uncomp_regex, 0);
671 671
@@ -677,7 +677,7 @@ static void regex_process(void)
677 } 677 }
678 } 678 }
679 old_pattern = pattern; 679 old_pattern = pattern;
680 680
681 /* Reset variables */ 681 /* Reset variables */
682 match_lines = xrealloc(match_lines, sizeof(int)); 682 match_lines = xrealloc(match_lines, sizeof(int));
683 match_lines[0] = -1; 683 match_lines[0] = -1;
@@ -694,7 +694,7 @@ static void regex_process(void)
694 j++; 694 j++;
695 } 695 }
696 } 696 }
697 697
698 num_matches = j; 698 num_matches = j;
699 if ((match_lines[0] != -1) && (num_flines > height - 2)) { 699 if ((match_lines[0] != -1) && (num_flines > height - 2)) {
700 if (match_backwards) { 700 if (match_backwards) {