Sync with upstream 95647bc8:

In ask(): override default option if any of alwaysyes/alwaysno/rdonly is
set.

Bug: 133725065
Merged-In: I1d9f5fe46aed85a9d374a9e91a0058a193f4cf43
Change-Id: I1d9f5fe46aed85a9d374a9e91a0058a193f4cf43
diff --git a/main.c b/main.c
index 2b79cc0..6802afc 100644
--- a/main.c
+++ b/main.c
@@ -129,9 +129,10 @@
 	char prompt[256];
 	int c;
 
+	if (alwaysyes || alwaysno || rdonly)
+		def = (alwaysyes && !rdonly && !alwaysno);
+
 	if (preen) {
-		if (rdonly)
-			def = 0;
 		if (def)
 			printf("FIXED\n");
 		return def;
@@ -140,9 +141,9 @@
 	va_start(ap, fmt);
 	vsnprintf(prompt, sizeof(prompt), fmt, ap);
 	va_end(ap);
-	if (alwaysyes || rdonly) {
-		printf("%s? %s\n", prompt, rdonly ? "no" : "yes");
-		return !rdonly;
+	if (alwaysyes || alwaysno || rdonly) {
+		printf("%s? %s\n", prompt, def ? "yes" : "no");
+		return def;
 	}
 	do {
 		printf("%s? [yn] ", prompt);