]> git.ipfire.org Git - pakfire.git/commitdiff
ui: Fix yes/no order
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 5 Jun 2021 13:36:17 +0000 (13:36 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 5 Jun 2021 13:36:17 +0000 (13:36 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/ui.c

index f9fbaa82df760f31cd1f12b565927bd6cfab6e4b..f935ad7393da9c5a918abf79e7404d6a444019dc 100644 (file)
@@ -27,7 +27,7 @@ int pakfire_ui_confirm(Pakfire pakfire, const char* message, const char* questio
 
        // Skip this, if running in non-interactive mode
        if (pakfire_has_flag(pakfire, PAKFIRE_FLAGS_NON_INTERACTIVE))
-               return 1;
+               return 0;
 
        while (1) {
                // Print question
@@ -40,13 +40,13 @@ int pakfire_ui_confirm(Pakfire pakfire, const char* message, const char* questio
                        // Positive response
                        case 'Y':
                        case 'y':
-                               return 1;
+                               return 0;
 
                        // Negative response
                        case EOF:
                        case 'N':
                        case 'n':
-                               return 0;
+                               return 1;
 
                        // Unknown input, repeat
                        default:
@@ -54,5 +54,5 @@ int pakfire_ui_confirm(Pakfire pakfire, const char* message, const char* questio
                }
        }
 
-       return 0;
+       return 1;
 }