summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Jones <rich@koneko.home.annexia.org>2010-03-21 19:15:40 +0000
committerRichard Jones <rich@koneko.home.annexia.org>2010-03-22 10:41:45 +0000
commitdd12eaefb5879255be78f8233f7e503ffbf7c4f1 (patch)
treedddcd362cba51429896b41580658750bbe299752 /src
parent5ebf3a39340696fea0582a58074d22d11247a6e7 (diff)
downloadlibguestfs-dd12eaefb5879255be78f8233f7e503ffbf7c4f1.tar.gz
libguestfs-dd12eaefb5879255be78f8233f7e503ffbf7c4f1.tar.xz
libguestfs-dd12eaefb5879255be78f8233f7e503ffbf7c4f1.zip
Mac OS X: implement readline functions.
OS X has an older version of readline with some differences in the names of functions.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/generator.ml15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/generator.ml b/src/generator.ml
index ba883ea7..551b6bc6 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -7459,7 +7459,16 @@ generator (const char *text, int state)
#endif /* HAVE_LIBREADLINE */
-char **do_completion (const char *text, int start, int end)
+#ifdef HAVE_RL_COMPLETION_MATCHES
+#define RL_COMPLETION_MATCHES rl_completion_matches
+#else
+#ifdef HAVE_COMPLETION_MATCHES
+#define RL_COMPLETION_MATCHES completion_matches
+#endif
+#endif /* else just fail if we don't have either symbol */
+
+char **
+do_completion (const char *text, int start, int end)
{
char **matches = NULL;
@@ -7467,9 +7476,9 @@ char **do_completion (const char *text, int start, int end)
rl_completion_append_character = ' ';
if (start == 0)
- matches = rl_completion_matches (text, generator);
+ matches = RL_COMPLETION_MATCHES (text, generator);
else if (complete_dest_paths)
- matches = rl_completion_matches (text, complete_dest_paths_generator);
+ matches = RL_COMPLETION_MATCHES (text, complete_dest_paths_generator);
#endif
return matches;