From: Karel Zak Date: Thu, 1 Jul 2010 08:56:41 +0000 (+0200) Subject: cfdisk: fix --with-slang X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=541e6934e1fe6833b125c1c64f9a1108bc3d09fa;p=util-linux cfdisk: fix --with-slang Signed-off-by: Karel Zak --- diff --git a/fdisk/Makefile.am b/fdisk/Makefile.am index 9a9db0c2..36871f3c 100644 --- a/fdisk/Makefile.am +++ b/fdisk/Makefile.am @@ -54,7 +54,7 @@ endif if USE_SLANG sbin_PROGRAMS += cfdisk dist_man_MANS += cfdisk.8 -cfdisk_SOURCES = cfdisk.c $(fdisk_common) $(top_srcdir)/lib/mbsalign.c +cfdisk_SOURCES = cfdisk.c $(fdisk_common) cfdisk_CFLAGS = $(cflags_blkid) cfdisk_LDADD = -lslang $(ldadd_blkid) else diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c index 30550c0a..552858b6 100644 --- a/fdisk/cfdisk.c +++ b/fdisk/cfdisk.c @@ -64,6 +64,13 @@ #include #include #include + +#ifdef HAVE_SLANG_H +#include +#elif defined(HAVE_SLANG_SLANG_H) +#include +#endif + #ifdef HAVE_SLCURSES_H #include #elif defined(HAVE_SLANG_SLCURSES_H) @@ -73,6 +80,7 @@ #elif defined(HAVE_NCURSES_NCURSES_H) #include #endif + #include #include #include @@ -431,7 +439,8 @@ get_string(char *str, int len, char *def) { refresh(); -#if defined(HAVE_LIBNCURSESW) && defined(HAVE_WIDECHAR) +#if !defined(HAVE_SLCURSES_H) && !defined(HAVE_SLANG_SLCURSES_H) && \ + defined(HAVE_LIBNCURSESW) && defined(HAVE_WIDECHAR) while ((key = get_wch(&c)) != ERR && c != '\r' && c != '\n' && c != KEY_ENTER) { #else