Remove extraneous checks to config->noconfirm, shouldn't prompt user if noconfirm is set. Returns appropriate value immediately rather than later. Signed-off-by: Brendan Hide <brendan@swiftspirit.co.za> --- src/pacman/util.c | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/pacman/util.c b/src/pacman/util.c index b80b09a..9f2c6b5 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -645,12 +645,12 @@ static int question(short preset, char *fmt, va_list args) FILE *stream; if(config->noconfirm) { - stream = stdout; - } else { - /* Use stderr so questions are always displayed when redirecting output */ - stream = stderr; + return(preset); } + /* Use stderr so questions are always displayed when redirecting output */ + stream = stderr; + vfprintf(stream, fmt, args); if(preset) { @@ -659,11 +659,6 @@ static int question(short preset, char *fmt, va_list args) fprintf(stream, " %s ", _("[y/N]")); } - if(config->noconfirm) { - fprintf(stream, "\n"); - return(preset); - } - if(fgets(response, 32, stdin)) { strtrim(response); if(strlen(response) == 0) { -- 1.6.3.1