diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-30 17:57:03 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-30 17:57:03 +0000 |
commit | 3bba545a54addf59b63a003e7ada03fd8b29b5ba (patch) | |
tree | 948ce196f871abcf9410ca1521a3d2a5af6a3082 /miscutils/less.c | |
parent | b5a122b6f9643fb052d31390e435397960289154 (diff) | |
download | busybox-w32-3bba545a54addf59b63a003e7ada03fd8b29b5ba.tar.gz busybox-w32-3bba545a54addf59b63a003e7ada03fd8b29b5ba.tar.bz2 busybox-w32-3bba545a54addf59b63a003e7ada03fd8b29b5ba.zip |
done a dozen of randconfig test. guess what? ALL failed...
these are resulting fixes
Diffstat (limited to 'miscutils/less.c')
-rw-r--r-- | miscutils/less.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/miscutils/less.c b/miscutils/less.c index 60c54e610..807a5bf47 100644 --- a/miscutils/less.c +++ b/miscutils/less.c | |||
@@ -109,6 +109,8 @@ static int match_pos; /* signed! */ | |||
109 | static unsigned num_matches; | 109 | static unsigned num_matches; |
110 | static regex_t pattern; | 110 | static regex_t pattern; |
111 | static unsigned pattern_valid; | 111 | static unsigned pattern_valid; |
112 | #else | ||
113 | enum { pattern_valid = 0 }; | ||
112 | #endif | 114 | #endif |
113 | 115 | ||
114 | static struct termios term_orig, term_vi; | 116 | static struct termios term_orig, term_vi; |
@@ -168,7 +170,7 @@ static void read_lines(void) | |||
168 | { | 170 | { |
169 | #define readbuf bb_common_bufsiz1 | 171 | #define readbuf bb_common_bufsiz1 |
170 | char *current_line, *p; | 172 | char *current_line, *p; |
171 | unsigned old_max_fline = max_fline; | 173 | USE_FEATURE_LESS_REGEXP(unsigned old_max_fline = max_fline;) |
172 | int w = width; | 174 | int w = width; |
173 | char last_terminated = terminated; | 175 | char last_terminated = terminated; |
174 | 176 | ||
@@ -337,6 +339,7 @@ static char ctrlconv[] = | |||
337 | "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x40\x4b\x4c\x4d\x4e\x4f" | 339 | "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x40\x4b\x4c\x4d\x4e\x4f" |
338 | "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"; | 340 | "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"; |
339 | 341 | ||
342 | #if ENABLE_FEATURE_LESS_REGEXP | ||
340 | static void print_found(const char *line) | 343 | static void print_found(const char *line) |
341 | { | 344 | { |
342 | int match_status; | 345 | int match_status; |
@@ -397,6 +400,9 @@ static void print_found(const char *line) | |||
397 | printf(CLEAR_2_EOL"%s%s\n", growline, str); | 400 | printf(CLEAR_2_EOL"%s%s\n", growline, str); |
398 | free(growline); | 401 | free(growline); |
399 | } | 402 | } |
403 | #else | ||
404 | void print_found(const char *line); | ||
405 | #endif | ||
400 | 406 | ||
401 | static void print_ascii(const char *str) | 407 | static void print_ascii(const char *str) |
402 | { | 408 | { |
@@ -718,6 +724,7 @@ static void colon_process(void) | |||
718 | } | 724 | } |
719 | } | 725 | } |
720 | 726 | ||
727 | #if ENABLE_FEATURE_LESS_REGEXP | ||
721 | static int normalize_match_pos(int match) | 728 | static int normalize_match_pos(int match) |
722 | { | 729 | { |
723 | match_pos = match; | 730 | match_pos = match; |
@@ -728,7 +735,6 @@ static int normalize_match_pos(int match) | |||
728 | return match_pos; | 735 | return match_pos; |
729 | } | 736 | } |
730 | 737 | ||
731 | #if ENABLE_FEATURE_LESS_REGEXP | ||
732 | static void goto_match(int match) | 738 | static void goto_match(int match) |
733 | { | 739 | { |
734 | if (num_matches) | 740 | if (num_matches) |