Ignore:
Timestamp:
Jul 28, 2002, 11:48:47 AM (23 years ago)
Author:
umoeller
Message:

Misc fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/dosh2.c

    r170 r194  
    20462046
    20472047                // skip extra asterisks
     2048                /*
    20482049                do
    20492050                {
    20502051                    ++pMask;
    20512052                } while (*pMask == '*');
     2053                */
     2054
     2055                while (*(++pMask) == '*')       // V0.9.20 (2002-07-25) [umoeller]
     2056                    ;
    20522057
    20532058                // pMask points to after '*';
     
    20892094
    20902095/*
    2091  *@@ doshMatch:
     2096 *@@ doshMatchCase:
    20922097 *      this matches '*' and '?' wildcards, similar to what
    2093  *      DosEditName does. It returns TRUE if the given name
    2094  *      matches the given mask.
    2095  *
    2096  *      However, this does not require a file to be present, but
    2097  *      works on strings only.
     2098 *      DosEditName does. However, this does not require a
     2099 *      file to be present, but works on strings only.
     2100 *
     2101 *      Returns TRUE if the given name matches the given mask.
    20982102 *
    20992103 *      This accepts both short and fully qualified masks and
     
    21062110 *          wildcards.
    21072111 *
    2108  *      --  This compares without respect to case always.
     2112 *      --  This compares WITH respect to case always. Upper-case
     2113 *          both the mask and the name before calling this, or
     2114 *          use doshMatch instead.
    21092115 *
    21102116 *      --  As opposed to the WPS, this handles multiple dots in
     
    21132119 *          one will.
    21142120 *
    2115  *      --  THIS COMPARES WITH RESPECT TO CASE.
    2116  *
    21172121 *      This replaces strhMatchOS2 which has been removed with
    21182122 *      V0.9.16 and is a lot faster than the old code, which has
     
    21272131    BOOL    brc = FALSE;
    21282132
    2129     int     iMaskDrive = -1,
    2130             iNameDrive = -1;
    2131 
    21322133    PCSZ    pLastMaskComponent,
    21332134            pLastNameComponent;
     
    21352136    ULONG   cbMaskPath = 0,
    21362137            cbNamePath = 0;
    2137 
    2138     CHAR    c;
    21392138
    21402139    if (pLastMaskComponent = strrchr(pcszMask, '\\'))
     
    21762175
    21772176/*
     2177 *@@ doshMatchCaseNoPath:
     2178 *      like doshMatchCase, but is faster if you are sure that
     2179 *      neither pcszMask nor pcszName contain path separators
     2180 *      ("\" characters). In other words, this is for short
     2181 *      filenames.
     2182 *
     2183 *@@added V0.9.20 (2002-07-25) [umoeller]
     2184 */
     2185
     2186BOOL doshMatchCaseNoPath(const char *pcszMask,     // in: mask (e.g. "*.TXT")
     2187                         const char *pcszName)     // in: string to check (e.g. "TEST.TXT")
     2188{
     2189    return PerformMatch(pcszMask,
     2190                        pcszName,
     2191                        // has dot?
     2192                        (strchr(pcszName, '.') != NULL));
     2193}
     2194
     2195/*
    21782196 *@@ doshMatch:
    21792197 *      like doshMatchCase, but compares without respect
     
    21922210
    21932211    memcpy(pszMask, pcszMask, cbMask + 1);
    2194     nlsUpper(pszMask, cbMask);
     2212    nlsUpper(pszMask);
    21952213    memcpy(pszName, pcszName, cbName + 1);
    2196     nlsUpper(pszName, cbName);
    2197 
    2198     return (doshMatchCase(pszMask,
    2199                           pszName));
    2200 }
     2214    nlsUpper(pszName);
     2215
     2216    return doshMatchCase(pszMask,
     2217                         pszName);
     2218}
Note: See TracChangeset for help on using the changeset viewer.