VirtualBox

Changeset 34542 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Nov 30, 2010 10:57:21 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
68333
Message:

RTGetOpt: Made it a bit less understanding about spaces after the option/value separator (':' or '='). See defect #5320.

File:
1 edited

Legend:

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

    r33540 r34542  
    207207            {
    208208                /*
    209                  * A value is required with the argument. We're trying to be very
     209                 * A value is required with the argument. We're trying to be
    210210                 * understanding here and will permit any of the following:
    211211                 *      --long12:value,  --long12=value, --long12 value,
    212212                 *      --long:value,    --long=value,   --long value,
    213                  *      --long: value,   --long= value
    214213                 *
    215214                 * If the option is index, then all trailing chars must be
     
    574573             * Find the argument value.
    575574             *
    576              * A value is required with the argument. We're trying to be very
     575             * A value is required with the argument. We're trying to be
    577576             * understanding here and will permit any of the following:
    578              *      -svalue, -s:value, -s=value,
    579              *      -s value, -s: value, -s= value
     577             *      -svalue, -s value, -s:value and -s=value
    580578             * (Ditto for long options.)
    581579             */
     
    583581            if (fShort)
    584582            {
    585                 if (    pszArgThis[2] == '\0'
    586                     ||  (  pszArgThis[3] == '\0'
    587                          && (   pszArgThis[2] == ':'
    588                              || pszArgThis[2] == '=')) )
     583                if (pszArgThis[2] == '\0')
    589584                {
    590585                    if (iThis + 1 >= pState->argc)
     
    636631                else
    637632                {
    638                     if (    pszArgThis[cchLong]     == '\0'
    639                         ||  pszArgThis[cchLong + 1] == '\0')
     633                    if (pszArgThis[cchLong] == '\0')
    640634                    {
    641635                        if (iThis + 1 >= pState->argc)
Note: See TracChangeset for help on using the changeset viewer.

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