Git fork

wildmatch: hide internal return values

WM_ABORT_ALL and WM_ABORT_TO_STARSTAR are used internally to limit
backtracking when a match fails, they are not of interest to the caller
and so should not be public.

Suggested-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Phillip Wood and committed by
Junio C Hamano
91b81b64 81b26f8f

+6 -3
+6 -1
wildmatch.c
··· 14 14 15 15 typedef unsigned char uchar; 16 16 17 + /* Internal return values */ 18 + #define WM_ABORT_ALL -1 19 + #define WM_ABORT_TO_STARSTAR -2 20 + 17 21 /* What character marks an inverted character class? */ 18 22 #define NEGATE_CLASS '!' 19 23 #define NEGATE_CLASS2 '^' ··· 278 282 /* Match the "pattern" against the "text" string. */ 279 283 int wildmatch(const char *pattern, const char *text, unsigned int flags) 280 284 { 281 - return dowild((const uchar*)pattern, (const uchar*)text, flags); 285 + int res = dowild((const uchar*)pattern, (const uchar*)text, flags); 286 + return res == WM_MATCH ? WM_MATCH : WM_NOMATCH; 282 287 }
-2
wildmatch.h
··· 6 6 7 7 #define WM_NOMATCH 1 8 8 #define WM_MATCH 0 9 - #define WM_ABORT_ALL -1 10 - #define WM_ABORT_TO_STARSTAR -2 11 9 12 10 int wildmatch(const char *pattern, const char *text, unsigned int flags); 13 11 #endif