VirtualBox

Changeset 33762 in vbox


Ignore:
Timestamp:
Nov 4, 2010 12:48:02 PM (14 years ago)
Author:
vboxsync
Message:

VBoxService/Exec: Bugfixes for argument list construction.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp

    r33696 r33762  
    10961096    AssertPtrReturn(ppapszArgv, VERR_INVALID_PARAMETER);
    10971097
     1098    bool fUseToolbox = false;
     1099    if (RTStrStr(papszArgs[0], "vbox_") == papszArgs[0])
     1100        fUseToolbox = true;
     1101
     1102    /* Skip argv[0] (= file name) if we don't run an internal
     1103     * VBoxService toolbox command - we already have a resolved one in pszFileName. */
    10981104    char *pszArgs;
    1099     int rc = RTGetOptArgvToString(&pszArgs, papszArgs,
     1105    int rc = RTGetOptArgvToString(&pszArgs,
     1106                                  fUseToolbox ? papszArgs : &papszArgs[1],
    11001107                                  RTGETOPTARGV_CNV_QUOTE_MS_CRT); /* RTGETOPTARGV_CNV_QUOTE_BOURNE_SH */
    1101     if (RT_SUCCESS(rc))
     1108    if (   RT_SUCCESS(rc)
     1109        && pszArgs)
    11021110    {
    11031111        /*
     
    11191127        }
    11201128        RTStrFree(pszArgs);
     1129    }
     1130    else /* No arguments given, just use the resolved file name as argv[0]. */
     1131    {
     1132        int iNumArgsIgnored;
     1133        rc = RTGetOptArgvFromString(ppapszArgv, &iNumArgsIgnored,
     1134                                    pszFileName, NULL /* Use standard separators. */);
    11211135    }
    11221136    return rc;
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