diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2019-06-27 03:15:01 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-06-27 03:15:01 +0000 |
commit | 1c143cf977bf48adcc6c50ddcaa896207137ac85 (patch) | |
tree | 2a7a51fda3383a86848454a6e6473a3db6fdccc0 | |
parent | 7a509b94526bce11e5b035af1356ce28c6c0a3fc (diff) | |
parent | 4eef244fcb822a91ce5df3eeb9d27719c328d2d5 (diff) | |
download | fsck_msdos-android10-qpr1-b-release.tar.gz |
Snap for 5691478 from 4eef244fcb822a91ce5df3eeb9d27719c328d2d5 to qt-qpr1-releaseandroid-10.0.0_r29android-10.0.0_r28android-10.0.0_r27android-10.0.0_r26android-10.0.0_r25android-10.0.0_r24android-10.0.0_r23android-10.0.0_r22android-10.0.0_r21android-10.0.0_r20android-10.0.0_r19android-10.0.0_r18android-10.0.0_r16android-10.0.0_r15android10-qpr1-releaseandroid10-qpr1-d-releaseandroid10-qpr1-c-s1-releaseandroid10-qpr1-c-releaseandroid10-qpr1-b-s1-releaseandroid10-qpr1-b-release
Change-Id: I39fe25d27e142cc6f09815ef0c5cd63db287c5e8
-rw-r--r-- | main.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -87,16 +87,15 @@ main(int argc, char **argv) exit(5); case 'n': alwaysno = 1; - alwaysyes = preen = 0; + alwaysyes = 0; break; case 'y': alwaysyes = 1; - alwaysno = preen = 0; + alwaysno = 0; break; case 'p': preen = 1; - alwaysyes = alwaysno = 0; break; default: @@ -130,9 +129,10 @@ ask(int def, const char *fmt, ...) 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; @@ -141,9 +141,9 @@ ask(int def, const char *fmt, ...) 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); |