summaryrefslogtreecommitdiffstats
path: root/fish/destpaths.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-05-25 13:54:11 +0100
committerRichard Jones <rjones@redhat.com>2010-05-25 13:59:44 +0100
commit21bd2db7cf259a17cc3922409937b849e4b83c0f (patch)
tree7b64681dd7a2afb77aa4a482c83b136474cc58a3 /fish/destpaths.c
parent53c3b9d2b03fa5cb0ac7e86a5a51f2a18a2b91c1 (diff)
downloadlibguestfs-21bd2db7cf259a17cc3922409937b849e4b83c0f.tar.gz
libguestfs-21bd2db7cf259a17cc3922409937b849e4b83c0f.tar.xz
libguestfs-21bd2db7cf259a17cc3922409937b849e4b83c0f.zip
fish: Don't eat words when completing case-insensitive paths (RHBZ#582993).
Diffstat (limited to 'fish/destpaths.c')
-rw-r--r--fish/destpaths.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/fish/destpaths.c b/fish/destpaths.c
index 403fe7f5..5ed93ec7 100644
--- a/fish/destpaths.c
+++ b/fish/destpaths.c
@@ -230,7 +230,20 @@ complete_dest_paths_generator (const char *text, int state)
word = &words[index];
index++;
- if (STRCASEEQLEN (word->name, text, len)) {
+ /* Whether we should match case insensitively here or not is
+ * determined by the value of the completion-ignore-case readline
+ * variable. Default to case insensitive. (See: RHBZ#582993).
+ */
+ char *cic_var = rl_variable_value ("completion-ignore-case");
+ int cic = 1;
+ if (cic_var && STREQ (cic_var, "off"))
+ cic = 0;
+
+ int matches =
+ cic ? STRCASEEQLEN (word->name, text, len)
+ : STREQLEN (word->name, text, len);
+
+ if (matches) {
if (word->is_dir)
rl_completion_append_character = '/';