diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-23 03:16:08 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-23 03:16:08 +0200 |
commit | f2cbb03a378aa48f2e08b64877d54da3fab4ea6a (patch) | |
tree | 35ff7449ba394e4e0a84a19a70eafa7b181d8d71 /loginutils | |
parent | 7b4cd6f7b07b816c4b36d686fe47c5cfec7f5abf (diff) | |
download | busybox-w32-f2cbb03a378aa48f2e08b64877d54da3fab4ea6a.tar.gz busybox-w32-f2cbb03a378aa48f2e08b64877d54da3fab4ea6a.tar.bz2 busybox-w32-f2cbb03a378aa48f2e08b64877d54da3fab4ea6a.zip |
*: optimize most of isXXXXX() macros
text data bss dec hex filename
824164 453 6812 831429 cafc5 busybox_old
823730 453 6812 830995 cae13 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/login.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/loginutils/login.c b/loginutils/login.c index ed2ab7f80..70e85625b 100644 --- a/loginutils/login.c +++ b/loginutils/login.c | |||
@@ -225,19 +225,22 @@ static void get_username_or_die(char *buf, int size_buf) | |||
225 | /* skip whitespace */ | 225 | /* skip whitespace */ |
226 | do { | 226 | do { |
227 | c = getchar(); | 227 | c = getchar(); |
228 | if (c == EOF) exit(EXIT_FAILURE); | 228 | if (c == EOF) |
229 | exit(EXIT_FAILURE); | ||
229 | if (c == '\n') { | 230 | if (c == '\n') { |
230 | if (!--cntdown) exit(EXIT_FAILURE); | 231 | if (!--cntdown) |
232 | exit(EXIT_FAILURE); | ||
231 | goto prompt; | 233 | goto prompt; |
232 | } | 234 | } |
233 | } while (isspace(c)); | 235 | } while (isspace(c)); /* maybe isblank? */ |
234 | 236 | ||
235 | *buf++ = c; | 237 | *buf++ = c; |
236 | if (!fgets(buf, size_buf-2, stdin)) | 238 | if (!fgets(buf, size_buf-2, stdin)) |
237 | exit(EXIT_FAILURE); | 239 | exit(EXIT_FAILURE); |
238 | if (!strchr(buf, '\n')) | 240 | if (!strchr(buf, '\n')) |
239 | exit(EXIT_FAILURE); | 241 | exit(EXIT_FAILURE); |
240 | while (isgraph(*buf)) buf++; | 242 | while ((unsigned char)*buf > ' ') |
243 | buf++; | ||
241 | *buf = '\0'; | 244 | *buf = '\0'; |
242 | } | 245 | } |
243 | 246 | ||