VirtualBox

Changeset 5971 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Dec 5, 2007 7:25:00 PM (17 years ago)
Author:
vboxsync
Message:

Use the new RT_C_* stuff in iprt/ctype.h. Made VBOX_LOG='*usb*=~0' work (case problem).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/log/log.cpp

    r5508 r5971  
    3939#include <iprt/stdarg.h>
    4040#include <iprt/string.h>
     41#include <iprt/ctype.h>
    4142#ifdef IN_RING3
    42 # include <iprt/ctype.h>
    4343# include <iprt/alloca.h>
    4444# include <stdio.h>
    45 #else
    46 # define isspace(ch) ( (ch) == ' ' || (ch) == '\t' )
    47 #endif
    48 
    49 
    50 
    51 /*******************************************************************************
    52 *   Defined Constants And Macros                                               *
    53 *******************************************************************************/
    54 /** Ascii to lower macro. */
    55 #define CHLOWER(ch)     (((unsigned char)(ch) < (unsigned char)'A') || ((unsigned char)(ch) > (unsigned char)'Z') ? (ch) : (ch) + ('a' - 'A'))
     45#endif
    5646
    5747
     
    274264                    {
    275265                        /* skip blanks. */
    276                         while (isspace(*pszVar) || *pszVar == '\n' || *pszVar == '\r')
     266                        while (RT_C_IS_SPACE(*pszVar))
    277267                            pszVar++;
    278268                        if (!*pszVar)
     
    317307
    318308                                /* check for value. */
    319                                 while (isspace(*pszVar) || *pszVar == '\n' || *pszVar == '\r')
     309                                while (RT_C_IS_SPACE(*pszVar))
    320310                                    pszVar++;
    321311                                if (*pszVar == '=' || *pszVar == ':')
     
    366356
    367357                        /* skip blanks and delimiters. */
    368                         while (isspace(*pszVar) || *pszVar == '\n' || *pszVar == '\r' || *pszVar == ';')
     358                        while (RT_C_IS_SPACE(*pszVar) || *pszVar == ';')
    369359                            pszVar++;
    370360                    } /* while more environment variable value left */
     
    888878    for (;;)
    889879    {
    890         if (CHLOWER(*pszGrp) != CHLOWER(*pachMask))
     880        if (RT_C_TO_LOWER(*pszGrp) != RT_C_TO_LOWER(*pachMask))
    891881        {
    892882            /*
     
    907897
    908898            /* do extremely minimal matching (fixme) */
    909             pszGrp = strchr(pszGrp, *pachMask);
    910             if (!pszGrp)
     899            const char *pszTmp = strchr(pszGrp, RT_C_TO_LOWER(*pachMask));
     900            if (!pszTmp)
     901                pszTmp = strchr(pszGrp, RT_C_TO_UPPER(*pachMask));
     902            if (!pszTmp)
    911903                return false;
     904            pszGrp = pszTmp;
    912905            continue;
    913906        }
     
    11041097            const char *psz1 = aFlags[i].pszFlag;
    11051098            const char *psz2 = psz;
    1106             while (*psz1 == CHLOWER(*psz2))
     1099            while (*psz1 == RT_C_TO_LOWER(*psz2))
    11071100            {
    11081101                psz1++;
     
    11701163    {
    11711164        /* skip blanks. */
    1172         while (isspace(*pszVar) || *pszVar == '\n' || *pszVar == '\r')
     1165        while (RT_C_IS_SPACE(*pszVar))
    11731166            pszVar++;
    11741167        if (!*pszVar)
     
    12541247
    12551248        /* skip blanks and delimiters. */
    1256         while (isspace(*pszVar) || *pszVar == '\n' || *pszVar == '\r' || *pszVar == ';')
     1249        while (RT_C_IS_SPACE(*pszVar) || *pszVar == ';')
    12571250            pszVar++;
    12581251    } /* while more environment variable value left */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette