VirtualBox

Changeset 83982 in vbox


Ignore:
Timestamp:
Apr 26, 2020 11:36:21 PM (5 years ago)
Author:
vboxsync
Message:

IPRT/getopt.cpp: Assume options are 7-bit ASCII / basic latin, so we don't need to drag in the case tables in static builds.

File:
1 edited

Legend:

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

    r83979 r83982  
    4545*   Defined Constants And Macros                                                                                                 *
    4646*********************************************************************************************************************************/
    47 #ifdef IPRT_MINIMAL
     47#ifdef IN_RT_STATIC  /* We don't need full unicode case insensitive if we ASSUME basic latin only. */
    4848# define RTStrICmp  RTStrICmpAscii
    4949# define RTStrNICmp RTStrNICmpAscii
    50 #else
    5150#endif
    5251
     
    8887    pState->cNonOptions  = 0;
    8988
     89#ifdef RT_STRICT
    9090    /* validate the options. */
    9191    for (size_t i = 0; i < cOptions; i++)
     
    9595        Assert(paOptions[i].iShort != VINF_GETOPT_NOT_OPTION);
    9696        Assert(paOptions[i].iShort != '-');
    97     }
     97        if (paOptions[i].fFlags & RTGETOPT_FLAG_ICASE)
     98        {
     99            const char   *psz = paOptions[i].pszLong;
     100            unsigned char ch;
     101            while ((ch = *psz++) != '\0')
     102                Assert(ch <= 0x7f); /* ASSUMPTION that we can use RTStrICmpAscii and RTStrNICmpAscii. */
     103        }
     104    }
     105#endif
    98106
    99107    return VINF_SUCCESS;
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