Fix networking in the appliance.
[libguestfs.git] / fish / destpaths.c
index 403fe7f..5ed93ec 100644 (file)
@@ -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 = '/';