new libedit: Fix mismatch between 0 and pointers
authorJohn Marino <draco@marino.st>
Thu, 10 May 2012 00:26:13 +0000 (02:26 +0200)
committerJohn Marino <draco@marino.st>
Thu, 10 May 2012 21:39:01 +0000 (23:39 +0200)
Partially recreates commit:
678e8cc6002ecd3a79cdae95ac8b454437219fc5

"For better readability, don't compare pointers with 0 or assign 0
 to them. Use NULL instead."

contrib/libedit/src/filecomplete.c

index 49f8005..333a0fb 100644 (file)
@@ -448,7 +448,7 @@ fn_complete(EditLine *el,
 
        /* these can be used by function called in completion_matches() */
        /* or (*attempted_completion_function)() */
-       if (point != 0)
+       if (point != NULL)
                *point = (int)(li->cursor - li->buffer);
        if (end != NULL)
                *end = (int)(li->lastchar - li->buffer);
@@ -459,7 +459,7 @@ fn_complete(EditLine *el,
                    ct_encode_string(temp, &el->el_scratch),
                    cur_off - (int)len, cur_off);
        } else
-               matches = 0;
+               matches = NULL;
        if (!attempted_completion_function || 
            (over != NULL && !*over && !matches))
                matches = completion_matches(