Hu Tao
2014-Dec-04 08:40 UTC
[Libguestfs] [PATCH] fish: fix build warning when readline-devel is missing
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
fish/fish.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fish/fish.c b/fish/fish.c
index 0432774..20511f8 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -641,10 +641,12 @@ shell_script (void)
#define FISH "><fs> "
+#ifdef HAVE_LIBREADLINE
static char *ps1 = NULL; /* GUESTFISH_PS1 */
static char *ps_output = NULL; /* GUESTFISH_OUTPUT */
-static char *ps_restore = NULL; /* GUESTFISH_RESTORE */
static char *ps_init = NULL; /* GUESTFISH_INIT */
+#endif /* HAVE_LIBREADLINE */
+static char *ps_restore = NULL; /* GUESTFISH_RESTORE */
static char *line_read = NULL;
static char *
@@ -698,10 +700,12 @@ script (int prompt)
struct parsed_command pcmd;
if (prompt) {
+#ifdef HAVE_LIBREADLINE
if (ps_init) { /* GUESTFISH_INIT */
CLEANUP_FREE char *pi = decode_ps1 (ps_init);
printf ("%s", pi);
}
+#endif /* HAVE_LIBREADLINE */
printf (_("\n"
"Welcome to guestfish, the guest filesystem shell
for\n"
@@ -739,6 +743,7 @@ script (int prompt)
}
}
+#ifdef HAVE_LIBREADLINE
if (prompt) {
printf ("\n");
if (ps_restore) { /* GUESTFISH_RESTORE */
@@ -746,6 +751,7 @@ script (int prompt)
printf ("%s", pr);
}
}
+#endif /* HAVE_LIBREADLINE */
}
/* Parse a command string, splitting at whitespace, handling '!',
'#' etc.
--
1.9.3
Richard W.M. Jones
2014-Dec-05 12:42 UTC
Re: [Libguestfs] [PATCH] fish: fix build warning when readline-devel is missing
On Thu, Dec 04, 2014 at 04:40:58PM +0800, Hu Tao wrote:> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>Thanks, ACKed and will push it later today. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/