diff options
Diffstat (limited to 'src/pacman/util.c')
-rw-r--r-- | src/pacman/util.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c index 16939099..757244a5 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -40,7 +40,6 @@ #include "conf.h" extern int maxcols; -extern int neednl; extern config_t *config; /* does the same thing as 'mkdir -p' */ @@ -189,45 +188,6 @@ char *strtrim(char *str) return str; } -/* presents a prompt and gets a Y/N answer - */ -int yesno(char *fmt, ...) -{ - char response[32]; - va_list args; - - if(config->noconfirm) { - return(1); - } - - va_start(args, fmt); - vprintf(fmt, args); - va_end(args); - fflush(stdout); - neednl = 1; - if(fgets(response, 32, stdin)) { - /* trim whitespace and newlines */ - char *pch = response; - while(isspace(*pch)) { - pch++; - } - if(pch != response) { - memmove(response, pch, strlen(pch) + 1); - } - pch = response + strlen(response) - 1; - while(isspace(*pch)) { - pch--; - } - *++pch = 0; - strtrim(response); - - if(!strcasecmp(response, "Y") || !strcasecmp(response, "YES") || !strlen(response)) { - return(1); - } - } - return(0); -} - /* match a string against a regular expression */ int reg_match(char *string, char *pattern) { |