diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-07 15:08:12 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-07 15:08:12 +0200 |
| commit | 77cb6b99a436c20bb171e6cdad7b8b8b5ce3692c (patch) | |
| tree | d00b5b460baa99be5547a2236790dbea31f90a5d /libbb | |
| parent | 2f094ae82106e91cb210e79ddc2e5285377b549e (diff) | |
| download | busybox-w32-77cb6b99a436c20bb171e6cdad7b8b8b5ce3692c.tar.gz busybox-w32-77cb6b99a436c20bb171e6cdad7b8b8b5ce3692c.tar.bz2 busybox-w32-77cb6b99a436c20bb171e6cdad7b8b8b5ce3692c.zip | |
libbb: rename bb_ask -> bb_ask_noecho, bb_ask_confirmation -> bb_ask_y_confirmation
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
| -rw-r--r-- | libbb/ask_confirmation.c | 4 | ||||
| -rw-r--r-- | libbb/bb_askpass.c | 6 | ||||
| -rw-r--r-- | libbb/copy_file.c | 2 | ||||
| -rw-r--r-- | libbb/correct_password.c | 2 | ||||
| -rw-r--r-- | libbb/remove_file.c | 6 |
5 files changed, 10 insertions, 10 deletions
diff --git a/libbb/ask_confirmation.c b/libbb/ask_confirmation.c index 6fbed89f4..ccd983c29 100644 --- a/libbb/ask_confirmation.c +++ b/libbb/ask_confirmation.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* | 2 | /* |
| 3 | * bb_ask_confirmation implementation for busybox | 3 | * bb_ask_y_confirmation implementation for busybox |
| 4 | * | 4 | * |
| 5 | * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> | 5 | * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> |
| 6 | * | 6 | * |
| @@ -11,7 +11,7 @@ | |||
| 11 | /* Read a line from stdin. If the first non-whitespace char is 'y' or 'Y', | 11 | /* Read a line from stdin. If the first non-whitespace char is 'y' or 'Y', |
| 12 | * return 1. Otherwise return 0. | 12 | * return 1. Otherwise return 0. |
| 13 | */ | 13 | */ |
| 14 | int FAST_FUNC bb_ask_confirmation(void) | 14 | int FAST_FUNC bb_ask_y_confirmation(void) |
| 15 | { | 15 | { |
| 16 | char first = 0; | 16 | char first = 0; |
| 17 | int c; | 17 | int c; |
diff --git a/libbb/bb_askpass.c b/libbb/bb_askpass.c index 5599c82ef..aadc69108 100644 --- a/libbb/bb_askpass.c +++ b/libbb/bb_askpass.c | |||
| @@ -13,11 +13,11 @@ static void askpass_timeout(int UNUSED_PARAM ignore) | |||
| 13 | { | 13 | { |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | char* FAST_FUNC bb_ask_stdin(const char *prompt) | 16 | char* FAST_FUNC bb_ask_noecho_stdin(const char *prompt) |
| 17 | { | 17 | { |
| 18 | return bb_ask(STDIN_FILENO, 0, prompt); | 18 | return bb_ask_noecho(STDIN_FILENO, 0, prompt); |
| 19 | } | 19 | } |
| 20 | char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt) | 20 | char* FAST_FUNC bb_ask_noecho(const int fd, int timeout, const char *prompt) |
| 21 | { | 21 | { |
| 22 | /* Was static char[BIGNUM] */ | 22 | /* Was static char[BIGNUM] */ |
| 23 | enum { sizeof_passwd = 128 }; | 23 | enum { sizeof_passwd = 128 }; |
diff --git a/libbb/copy_file.c b/libbb/copy_file.c index be9006631..1b8befd65 100644 --- a/libbb/copy_file.c +++ b/libbb/copy_file.c | |||
| @@ -48,7 +48,7 @@ static int ask_and_unlink(const char *dest, int flags) | |||
| 48 | // (No "opening without O_EXCL", no "unlink only if -f") | 48 | // (No "opening without O_EXCL", no "unlink only if -f") |
| 49 | // Or else we will end up having 3 open()s! | 49 | // Or else we will end up having 3 open()s! |
| 50 | fprintf(stderr, "%s: overwrite '%s'? ", applet_name, dest); | 50 | fprintf(stderr, "%s: overwrite '%s'? ", applet_name, dest); |
| 51 | if (!bb_ask_confirmation()) | 51 | if (!bb_ask_y_confirmation()) |
| 52 | return 0; /* not allowed to overwrite */ | 52 | return 0; /* not allowed to overwrite */ |
| 53 | } | 53 | } |
| 54 | if (unlink(dest) < 0) { | 54 | if (unlink(dest) < 0) { |
diff --git a/libbb/correct_password.c b/libbb/correct_password.c index a6f7d9b3d..cbe6cb387 100644 --- a/libbb/correct_password.c +++ b/libbb/correct_password.c | |||
| @@ -106,7 +106,7 @@ int FAST_FUNC ask_and_check_password_extended(const struct passwd *pw, | |||
| 106 | if (!pw_pass[0]) /* empty password field? */ | 106 | if (!pw_pass[0]) /* empty password field? */ |
| 107 | return CHECKPASS_PW_HAS_EMPTY_PASSWORD; | 107 | return CHECKPASS_PW_HAS_EMPTY_PASSWORD; |
| 108 | 108 | ||
| 109 | plaintext = bb_ask(STDIN_FILENO, timeout, prompt); | 109 | plaintext = bb_ask_noecho(STDIN_FILENO, timeout, prompt); |
| 110 | if (!plaintext) { | 110 | if (!plaintext) { |
| 111 | /* EOF (such as ^D) or error (such as ^C) or timeout */ | 111 | /* EOF (such as ^D) or error (such as ^C) or timeout */ |
| 112 | return -1; | 112 | return -1; |
diff --git a/libbb/remove_file.c b/libbb/remove_file.c index 8a1324393..074ffae70 100644 --- a/libbb/remove_file.c +++ b/libbb/remove_file.c | |||
| @@ -41,7 +41,7 @@ int FAST_FUNC remove_file(const char *path, int flags) | |||
| 41 | ) { | 41 | ) { |
| 42 | fprintf(stderr, "%s: descend into directory '%s'? ", applet_name, | 42 | fprintf(stderr, "%s: descend into directory '%s'? ", applet_name, |
| 43 | path); | 43 | path); |
| 44 | if (!bb_ask_confirmation()) | 44 | if (!bb_ask_y_confirmation()) |
| 45 | return 0; | 45 | return 0; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| @@ -68,7 +68,7 @@ int FAST_FUNC remove_file(const char *path, int flags) | |||
| 68 | 68 | ||
| 69 | if (flags & FILEUTILS_INTERACTIVE) { | 69 | if (flags & FILEUTILS_INTERACTIVE) { |
| 70 | fprintf(stderr, "%s: remove directory '%s'? ", applet_name, path); | 70 | fprintf(stderr, "%s: remove directory '%s'? ", applet_name, path); |
| 71 | if (!bb_ask_confirmation()) | 71 | if (!bb_ask_y_confirmation()) |
| 72 | return status; | 72 | return status; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| @@ -92,7 +92,7 @@ int FAST_FUNC remove_file(const char *path, int flags) | |||
| 92 | || (flags & FILEUTILS_INTERACTIVE) | 92 | || (flags & FILEUTILS_INTERACTIVE) |
| 93 | ) { | 93 | ) { |
| 94 | fprintf(stderr, "%s: remove '%s'? ", applet_name, path); | 94 | fprintf(stderr, "%s: remove '%s'? ", applet_name, path); |
| 95 | if (!bb_ask_confirmation()) | 95 | if (!bb_ask_y_confirmation()) |
| 96 | return 0; | 96 | return 0; |
| 97 | } | 97 | } |
| 98 | 98 | ||
