summaryrefslogtreecommitdiffstats
path: root/fdisk/cfdisk.c
diff options
context:
space:
mode:
authorFrancesco Cosoleto2011-01-02 22:58:13 +0100
committerKarel Zak2011-01-05 16:18:08 +0100
commite66ac5d344dd038adb664e237c4c2610020f3f62 (patch)
tree8782b8fb7a51accbf7e0a8d9c56c538637abddd6 /fdisk/cfdisk.c
parentfdisk: quit with a single CTRL-D, confirm if necessary (diff)
downloadkernel-qcow2-util-linux-e66ac5d344dd038adb664e237c4c2610020f3f62.tar.gz
kernel-qcow2-util-linux-e66ac5d344dd038adb664e237c4c2610020f3f62.tar.xz
kernel-qcow2-util-linux-e66ac5d344dd038adb664e237c4c2610020f3f62.zip
include: add fallback for rpmatch()
Simple replacement code with hardcoded y/n responses to allow compilation on systems without rpmatch() such as Cygwin. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisk/cfdisk.c')
-rw-r--r--fdisk/cfdisk.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
index 866d02af0..95f1864d4 100644
--- a/fdisk/cfdisk.c
+++ b/fdisk/cfdisk.c
@@ -98,6 +98,7 @@
#endif
#include "nls.h"
+#include "rpmatch.h"
#include "blkdev.h"
#include "strutils.h"
#include "common.h"
@@ -1448,17 +1449,12 @@ get_kernel_geometry(void) {
static int
said_yes(char answer) {
-#ifdef HAVE_RPMATCH
char reply[2];
- int yn;
reply[0] = answer;
reply[1] = 0;
- yn = rpmatch(reply); /* 1: yes, 0: no, -1: ? */
- if (yn >= 0)
- return yn;
-#endif
- return (answer == 'y' || answer == 'Y');
+
+ return (rpmatch(reply) == 1) ? 1 : 0;
}
static void