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 /libbb/lineedit.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 'libbb/lineedit.c')
-rw-r--r-- | libbb/lineedit.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index a66398a95..2db85d0d4 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -111,15 +111,15 @@ static void cmdedit_set_out_char(int next_char) | |||
111 | #endif | 111 | #endif |
112 | { | 112 | { |
113 | if (initial_settings.c_lflag & ECHO) | 113 | if (initial_settings.c_lflag & ECHO) |
114 | putchar(c); | 114 | bb_putchar(c); |
115 | } | 115 | } |
116 | if (++cmdedit_x >= cmdedit_termw) { | 116 | if (++cmdedit_x >= cmdedit_termw) { |
117 | /* terminal is scrolled down */ | 117 | /* terminal is scrolled down */ |
118 | cmdedit_y++; | 118 | cmdedit_y++; |
119 | cmdedit_x = 0; | 119 | cmdedit_x = 0; |
120 | /* destroy "(auto)margin" */ | 120 | /* destroy "(auto)margin" */ |
121 | putchar(next_char); | 121 | bb_putchar(next_char); |
122 | putchar('\b'); | 122 | bb_putchar('\b'); |
123 | } | 123 | } |
124 | // Huh? What if command_ps[cursor] == '\0' (we are at the end already?) | 124 | // Huh? What if command_ps[cursor] == '\0' (we are at the end already?) |
125 | cursor++; | 125 | cursor++; |
@@ -137,7 +137,7 @@ static void goto_new_line(void) | |||
137 | { | 137 | { |
138 | input_end(); | 138 | input_end(); |
139 | if (cmdedit_x) | 139 | if (cmdedit_x) |
140 | putchar('\n'); | 140 | bb_putchar('\n'); |
141 | } | 141 | } |
142 | 142 | ||
143 | 143 | ||
@@ -149,7 +149,7 @@ static void out1str(const char *s) | |||
149 | 149 | ||
150 | static void beep(void) | 150 | static void beep(void) |
151 | { | 151 | { |
152 | putchar('\007'); | 152 | bb_putchar('\007'); |
153 | } | 153 | } |
154 | 154 | ||
155 | /* Move back one character */ | 155 | /* Move back one character */ |
@@ -197,7 +197,7 @@ static void redraw(int y, int back_cursor) | |||
197 | { | 197 | { |
198 | if (y > 0) /* up to start y */ | 198 | if (y > 0) /* up to start y */ |
199 | printf("\033[%dA", y); | 199 | printf("\033[%dA", y); |
200 | putchar('\r'); | 200 | bb_putchar('\r'); |
201 | put_prompt(); | 201 | put_prompt(); |
202 | input_end(); /* rewrite */ | 202 | input_end(); /* rewrite */ |
203 | printf("\033[J"); /* erase after cursor */ | 203 | printf("\033[J"); /* erase after cursor */ |
@@ -1585,8 +1585,8 @@ int read_line_input(const char* prompt, char* command, int maxsize, line_input_t | |||
1585 | beep(); | 1585 | beep(); |
1586 | else { | 1586 | else { |
1587 | *(command + cursor) = c; | 1587 | *(command + cursor) = c; |
1588 | putchar(c); | 1588 | bb_putchar(c); |
1589 | putchar('\b'); | 1589 | bb_putchar('\b'); |
1590 | } | 1590 | } |
1591 | break; | 1591 | break; |
1592 | #endif /* FEATURE_COMMAND_EDITING_VI */ | 1592 | #endif /* FEATURE_COMMAND_EDITING_VI */ |