diff options
| author | Naram Qashat <cyberbotx@cyberbotx.com> | 2010-06-20 18:42:58 -0400 |
|---|---|---|
| committer | Naram Qashat <cyberbotx@cyberbotx.com> | 2010-06-20 18:42:58 -0400 |
| commit | 381c9c8870fad4c544f29deec22ba4be3549a731 (patch) | |
| tree | f5f26e2dd380910b0ddd26e3d885d6bf56d40181 /src/wildcard.cpp | |
| parent | 2528dc80bd1b3e6b2c09db23eb51659e30128110 (diff) | |
The first of a few "CBX OCDing over code style" commits, focusing on include/* and src/* but not src/core/* or src/modules/*.
Diffstat (limited to 'src/wildcard.cpp')
| -rw-r--r-- | src/wildcard.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/wildcard.cpp b/src/wildcard.cpp index 1106a9cd6..42f0812f7 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -6,7 +6,7 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask, unsigned char *string = const_cast<unsigned char *>(str); // XXX: unsafe cast unsigned char *wild = const_cast<unsigned char *>(mask); // XXX: unsafe cast - while ((*string) && (*wild != '*')) + while (*string && *wild != '*') { if (case_sensitive) { @@ -28,12 +28,10 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask, if (*wild == '*') { if (!*++wild) - { return 1; - } mp = wild; - cp = string+1; + cp = string + 1; } else { @@ -41,8 +39,8 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask, { if (*wild == *string || *wild == '?') { - wild++; - string++; + ++wild; + ++string; } else { @@ -54,8 +52,8 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask, { if (tolower(*wild) == tolower(*string) || *wild == '?') { - wild++; - string++; + ++wild; + ++string; } else { @@ -68,9 +66,7 @@ static bool match_internal(const unsigned char *str, const unsigned char *mask, } while (*wild == '*') - { - wild++; - } + ++wild; return !*wild; } |
