From 8f1e7d9e55ee0964222913170f79858cac0912c3 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 12 Jan 2015 10:22:30 +0100 Subject: [PATCH] question: accept enter key as default preset value. --- bin/xbps-install/question.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/xbps-install/question.c b/bin/xbps-install/question.c index 8fa94b48..bea2c317 100644 --- a/bin/xbps-install/question.c +++ b/bin/xbps-install/question.c @@ -49,9 +49,8 @@ question(bool preset, const char *fmt, va_list ap) fprintf(stderr, " %s ", "[y/N]"); if (fgets(response, sizeof(response), stdin)) { - if (strlen(response) == 0) + if (response[0] == '\n') return preset; - if (response[0] == 'y' || response[0] == 'Y') return true; if (response[0] == 'n' || response[0] == 'N')