summaryrefslogtreecommitdiff
path: root/sbin/disklabel
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-11-05 02:48:44 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-11-05 02:48:44 +0000
commitc778a727738b57d18248be57607cfc5907f29e20 (patch)
tree1617e9a9c4b84d53bfa82cd0787d45740c42cc48 /sbin/disklabel
parent64be7fb6df20d1f12f6b3463e42b0a66a1311256 (diff)
Document ^D to get out of overlap prompt and remove duplicate exit condition
Diffstat (limited to 'sbin/disklabel')
-rw-r--r--sbin/disklabel/editor.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 869c234e0cf..17f86c9f44a 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.25 1997/11/04 19:46:39 millert Exp $ */
+/* $OpenBSD: editor.c,v 1.26 1997/11/05 02:48:43 millert Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -31,7 +31,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: editor.c,v 1.25 1997/11/04 19:46:39 millert Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.26 1997/11/05 02:48:43 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -1322,15 +1322,14 @@ has_overlap(lp, freep, resolve)
/* Get partition to disable or ^D */
do {
- printf("Disable which one? [%c %c] ",
+ printf("Disable which one? (^D to abort) [%c %c] ",
'a' + i, 'a' + j);
buf[0] = '\0';
- if (!fgets(buf, sizeof(buf), stdin))
+ if (!fgets(buf, sizeof(buf), stdin)) {
+ putchar('\n');
return(1); /* ^D */
+ }
c = buf[0] - 'a';
- if ((buf[1] == '\n' || buf[1] == '\0')
- && (c == i || c == j))
- break;
} while (buf[1] != '\n' && buf[1] != '\0' &&
c != i && c != j);