1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
http://bugs.gentoo.org/326373
From 541e6934e1fe6833b125c1c64f9a1108bc3d09fa Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Thu, 1 Jul 2010 10:56:41 +0200
Subject: [PATCH] cfdisk: fix --with-slang
Signed-off-by: Karel Zak <kzak@redhat.com>
---
fdisk/Makefile.in | 2 +-
fdisk/cfdisk.c | 11 ++++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
--- a/fdisk/Makefile.in
+++ b/fdisk/Makefile.in
@@ -88,8 +88,7 @@
@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@am_cfdisk_OBJECTS = cfdisk-cfdisk.$(OBJEXT) \
@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@ $(am__objects_2)
@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@am_cfdisk_OBJECTS = cfdisk-cfdisk.$(OBJEXT) \
-@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@ $(am__objects_2) \
-@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@ cfdisk-mbsalign.$(OBJEXT)
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@ $(am__objects_2)
cfdisk_OBJECTS = $(am_cfdisk_OBJECTS)
@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@cfdisk_DEPENDENCIES = $(ldadd_blkid)
@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@cfdisk_DEPENDENCIES = $(ldadd_blkid)
@@ -443,7 +444,7 @@
@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_STATIC_SFDISK_TRUE@sfdisk_static_SOURCES = $(sfdisk_SOURCES)
@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_STATIC_SFDISK_TRUE@sfdisk_static_LDFLAGS = -all-static
@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@cfdisk_SOURCES = cfdisk.c $(fdisk_common)
-@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@cfdisk_SOURCES = cfdisk.c $(fdisk_common) $(top_srcdir)/lib/mbsalign.c
+@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@cfdisk_SOURCES = cfdisk.c $(fdisk_common)
@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@cfdisk_CFLAGS = $(cflags_blkid)
@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@USE_SLANG_TRUE@cfdisk_CFLAGS = $(cflags_blkid)
@ARCH_M68K_FALSE@@ARCH_SPARC_FALSE@@HAVE_NCURSES_TRUE@@USE_SLANG_FALSE@cfdisk_LDADD = @NCURSES_LIBS@ $(ldadd_blkid)
diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
index 30550c0..552858b 100644
--- a/fdisk/cfdisk.c
+++ b/fdisk/cfdisk.c
@@ -64,6 +64,13 @@
#include <errno.h>
#include <getopt.h>
#include <fcntl.h>
+
+#ifdef HAVE_SLANG_H
+#include <slang.h>
+#elif defined(HAVE_SLANG_SLANG_H)
+#include <slang/slang.h>
+#endif
+
#ifdef HAVE_SLCURSES_H
#include <slcurses.h>
#elif defined(HAVE_SLANG_SLCURSES_H)
@@ -73,6 +80,7 @@
#elif defined(HAVE_NCURSES_NCURSES_H)
#include <ncurses/ncurses.h>
#endif
+
#include <signal.h>
#include <math.h>
#include <string.h>
@@ -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
--
1.7.1
|