[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH] fish: Fix build error if built without readline.



-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
>From 9ee020ba7639b3c8f87c487544bd90b02ce357fc Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones redhat com>
Date: Thu, 20 May 2010 10:11:18 +0100
Subject: [PATCH] fish: Fix build error if built without readline.

fish.c:1447: error: 'add_history_line' defined but not used [-Wunused-function]

(Reported by Matt Booth)
---
 fish/fish.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fish/fish.c b/fish/fish.c
index 5d89d60..a32ed4d 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -65,7 +65,9 @@ static void script (int prompt);
 static void cmdline (char *argv[], int optind, int argc);
 static void initialize_readline (void);
 static void cleanup_readline (void);
+#ifdef HAVE_LIBREADLINE
 static void add_history_line (const char *);
+#endif
 static void print_shell_quote (FILE *stream, const char *str);
 
 /* Currently open libguestfs handle. */
@@ -1443,14 +1445,14 @@ cleanup_readline (void)
 #endif
 }
 
+#ifdef HAVE_LIBREADLINE
 static void
 add_history_line (const char *line)
 {
-#ifdef HAVE_LIBREADLINE
   add_history (line);
   nr_history_lines++;
-#endif
 }
+#endif
 
 int
 xwrite (int fd, const void *v_buf, size_t len)
-- 
1.6.6.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]