change strncasecmp() == 0 to STRCASEEQLEN()
[libguestfs.git] / fish / destpaths.c
index 9a3da82..c12c64a 100644 (file)
@@ -166,9 +166,9 @@ complete_dest_paths_generator (const char *text, int state)
           for (i = 0; i < dirents->len; ++i) {
             int err;
 
-            if (strcmp (dirents->val[i].name, ".") != 0 &&
-                strcmp (dirents->val[i].name, "..") != 0) {
-              if (strcmp (dir, "/") == 0)
+            if (STRNEQ (dirents->val[i].name, ".") &&
+                STRNEQ (dirents->val[i].name, "..")) {
+              if (STREQ (dir, "/"))
                 err = asprintf (&p, "/%s", dirents->val[i].name);
               else
                 err = asprintf (&p, "%s/%s", dir, dirents->val[i].name);
@@ -215,7 +215,7 @@ complete_dest_paths_generator (const char *text, int state)
     word = &words[index];
     index++;
 
-    if (strncasecmp (word->name, text, len) == 0) {
+    if (STRCASEEQLEN (word->name, text, len)) {
       if (word->is_dir)
         rl_completion_append_character = '/';