diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-03-30 01:16:32 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-03-30 01:16:32 +0000 |
commit | 061e74f131d19f4af4f70f4ea88c02a97b0c505b (patch) | |
tree | 122d89f9f395abf338b4ad0f47bb4848779dcb99 | |
parent | c865357eff6a85799d8ed04e2da7d69ca3bdea79 (diff) |
when asking y or n, accept "F" which forces yes from the on. i have
wished for this for 10+ year, but always forgotten to make the change
after cleaning up a nasty file system; ok pedro millert
-rw-r--r-- | sbin/fsck_ext2fs/utilities.c | 10 | ||||
-rw-r--r-- | sbin/fsck_ffs/utilities.c | 12 | ||||
-rw-r--r-- | sbin/fsck_msdos/main.c | 10 |
3 files changed, 22 insertions, 10 deletions
diff --git a/sbin/fsck_ext2fs/utilities.c b/sbin/fsck_ext2fs/utilities.c index 054e523724f..402d37b74c7 100644 --- a/sbin/fsck_ext2fs/utilities.c +++ b/sbin/fsck_ext2fs/utilities.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utilities.c,v 1.14 2003/06/11 06:22:13 deraadt Exp $ */ +/* $OpenBSD: utilities.c,v 1.15 2006/03/30 01:16:30 deraadt Exp $ */ /* $NetBSD: utilities.c,v 1.6 2001/02/04 21:19:34 christos Exp $ */ /* @@ -92,10 +92,14 @@ reply(char *question) printf("%s? yes\n\n", question); return (1); } - do { - printf("%s? [yn] ", question); + do { + printf("%s? [Fyn] ", question); (void) fflush(stdout); c = getc(stdin); + if (c == 'F') { + yflag = 1; + return (1); + } while (c != '\n' && getc(stdin) != '\n') if (feof(stdin)) return (0); diff --git a/sbin/fsck_ffs/utilities.c b/sbin/fsck_ffs/utilities.c index b383edc0afc..65e20ee6295 100644 --- a/sbin/fsck_ffs/utilities.c +++ b/sbin/fsck_ffs/utilities.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utilities.c,v 1.24 2006/03/22 20:24:32 deraadt Exp $ */ +/* $OpenBSD: utilities.c,v 1.25 2006/03/30 01:16:31 deraadt Exp $ */ /* $NetBSD: utilities.c,v 1.18 1996/09/27 22:45:20 christos Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)utilities.c 8.1 (Berkeley) 6/5/93"; #else -static const char rcsid[] = "$OpenBSD: utilities.c,v 1.24 2006/03/22 20:24:32 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: utilities.c,v 1.25 2006/03/30 01:16:31 deraadt Exp $"; #endif #endif /* not lint */ @@ -102,10 +102,14 @@ reply(char *question) printf("%s? yes\n\n", question); return (1); } - do { - printf("%s? [yn] ", question); + do { + printf("%s? [Fyn?] ", question); (void) fflush(stdout); c = getc(stdin); + if (c == 'F') { + yflag = 1; + return (1); + } while (c != '\n' && getc(stdin) != '\n') { if (feof(stdin)) { resolved = 0; diff --git a/sbin/fsck_msdos/main.c b/sbin/fsck_msdos/main.c index 47bde26a491..fb6172b70d0 100644 --- a/sbin/fsck_msdos/main.c +++ b/sbin/fsck_msdos/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.14 2005/02/03 05:03:50 jaredy Exp $ */ +/* $OpenBSD: main.c,v 1.15 2006/03/30 01:16:31 deraadt Exp $ */ /* $NetBSD: main.c,v 1.8 1996/10/17 20:29:53 cgd Exp $ */ /* @@ -35,7 +35,7 @@ #ifndef lint -static char rcsid[] = "$OpenBSD: main.c,v 1.14 2005/02/03 05:03:50 jaredy Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.15 2006/03/30 01:16:31 deraadt Exp $"; #endif /* not lint */ #include <stdlib.h> @@ -134,9 +134,13 @@ ask(int def, const char *fmt, ...) return (!rdonly); } do { - printf("%s? [yn] ", prompt); + printf("%s? [Fyn] ", prompt); fflush(stdout); c = getchar(); + if (c == 'F') { + alwaysyes = 1; + return (1); + } while (c != '\n' && getchar() != '\n') if (feof(stdin)) return (0); |