diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-27 10:20:47 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-09-27 10:20:47 +0000 |
commit | 4daad9004d8f07991516970a1cbd77756fae7041 (patch) | |
tree | f1a17e4b168ef8fdf8af92ac5ce8deba89d38db2 /miscutils/less.c | |
parent | 1acdc89e992eb3f0548ff48ba586b31c9a0ae232 (diff) | |
download | busybox-w32-4daad9004d8f07991516970a1cbd77756fae7041.tar.gz busybox-w32-4daad9004d8f07991516970a1cbd77756fae7041.tar.bz2 busybox-w32-4daad9004d8f07991516970a1cbd77756fae7041.zip |
introduce bb_putchar(). saves ~1800 on uclibc (less on glibc).
Diffstat (limited to 'miscutils/less.c')
-rw-r--r-- | miscutils/less.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/miscutils/less.c b/miscutils/less.c index a2221cfca..ec9c00f24 100644 --- a/miscutils/less.c +++ b/miscutils/less.c | |||
@@ -173,7 +173,7 @@ static void less_exit(int code) | |||
173 | * and restore it when we exit. Less does this with the | 173 | * and restore it when we exit. Less does this with the |
174 | * "ti" and "te" termcap commands; can this be done with | 174 | * "ti" and "te" termcap commands; can this be done with |
175 | * only termios.h? */ | 175 | * only termios.h? */ |
176 | putchar('\n'); | 176 | bb_putchar('\n'); |
177 | fflush_stdout_and_exit(code); | 177 | fflush_stdout_and_exit(code); |
178 | } | 178 | } |
179 | 179 | ||
@@ -419,7 +419,7 @@ static void status_print(void) | |||
419 | 419 | ||
420 | clear_line(); | 420 | clear_line(); |
421 | if (cur_fline && cur_fline < max_fline - max_displayed_line) { | 421 | if (cur_fline && cur_fline < max_fline - max_displayed_line) { |
422 | putchar(':'); | 422 | bb_putchar(':'); |
423 | return; | 423 | return; |
424 | } | 424 | } |
425 | p = "(END)"; | 425 | p = "(END)"; |
@@ -755,7 +755,7 @@ static char* less_gets(int sz) | |||
755 | continue; | 755 | continue; |
756 | if (i >= width - sz - 1) | 756 | if (i >= width - sz - 1) |
757 | continue; /* len limit */ | 757 | continue; /* len limit */ |
758 | putchar(c); | 758 | bb_putchar(c); |
759 | result[i++] = c; | 759 | result[i++] = c; |
760 | result = xrealloc(result, i+1); | 760 | result = xrealloc(result, i+1); |
761 | result[i] = '\0'; | 761 | result[i] = '\0'; |
@@ -916,7 +916,7 @@ static void regex_process(void) | |||
916 | 916 | ||
917 | /* Get the uncompiled regular expression from the user */ | 917 | /* Get the uncompiled regular expression from the user */ |
918 | clear_line(); | 918 | clear_line(); |
919 | putchar((option_mask32 & LESS_STATE_MATCH_BACKWARDS) ? '?' : '/'); | 919 | bb_putchar((option_mask32 & LESS_STATE_MATCH_BACKWARDS) ? '?' : '/'); |
920 | uncomp_regex = less_gets(1); | 920 | uncomp_regex = less_gets(1); |
921 | if (!uncomp_regex[0]) { | 921 | if (!uncomp_regex[0]) { |
922 | free(uncomp_regex); | 922 | free(uncomp_regex); |
@@ -969,7 +969,7 @@ static void number_process(int first_digit) | |||
969 | num_input[i] = less_getch(); | 969 | num_input[i] = less_getch(); |
970 | if (!num_input[i] || !isdigit(num_input[i])) | 970 | if (!num_input[i] || !isdigit(num_input[i])) |
971 | break; | 971 | break; |
972 | putchar(num_input[i]); | 972 | bb_putchar(num_input[i]); |
973 | i++; | 973 | i++; |
974 | } | 974 | } |
975 | 975 | ||
@@ -1024,7 +1024,7 @@ static void flag_change(void) | |||
1024 | int keypress; | 1024 | int keypress; |
1025 | 1025 | ||
1026 | clear_line(); | 1026 | clear_line(); |
1027 | putchar('-'); | 1027 | bb_putchar('-'); |
1028 | keypress = less_getch(); | 1028 | keypress = less_getch(); |
1029 | 1029 | ||
1030 | switch (keypress) { | 1030 | switch (keypress) { |
@@ -1049,7 +1049,7 @@ static void show_flag_status(void) | |||
1049 | int flag_val; | 1049 | int flag_val; |
1050 | 1050 | ||
1051 | clear_line(); | 1051 | clear_line(); |
1052 | putchar('_'); | 1052 | bb_putchar('_'); |
1053 | keypress = less_getch(); | 1053 | keypress = less_getch(); |
1054 | 1054 | ||
1055 | switch (keypress) { | 1055 | switch (keypress) { |