VirtualBox

Changeset 64964 in vbox


Ignore:
Timestamp:
Dec 19, 2016 3:11:39 PM (8 years ago)
Author:
vboxsync
Message:

Main/VirtualBox: no need to do the fix to sanitiseMachineFilename() twice

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r64962 r64964  
    14301430    };
    14311431
    1432     if (!strName.isEmpty())
    1433     {
    1434         char *pszName = strName.mutableRaw();
    1435         ssize_t cReplacements = RTStrPurgeComplementSet(pszName, s_uszValidRangePairs, '_');
    1436         Assert(cReplacements >= 0);
    1437         NOREF(cReplacements);
    1438 
    1439         /* No leading dot or dash. */
    1440         if (pszName[0] == '.' || pszName[0] == '-')
    1441             pszName[0] = '_';
    1442 
    1443         /* No trailing dot. */
    1444         if (pszName[strName.length() - 1] == '.')
    1445             pszName[strName.length() - 1] = '_';
    1446 
    1447         /* Mangle leading and trailing spaces. */
    1448         for (size_t i = 0; pszName[i] == ' '; ++i)
    1449             pszName[i] = '_';
    1450         for (size_t i = strName.length() - 1; i && pszName[i] == ' '; --i)
    1451             pszName[i] = '_';
    1452     }
     1432    char *pszName = strName.mutableRaw();
     1433    ssize_t cReplacements = RTStrPurgeComplementSet(pszName, s_uszValidRangePairs, '_');
     1434    Assert(cReplacements >= 0);
     1435    NOREF(cReplacements);
     1436
     1437    /* No leading dot or dash. */
     1438    if (pszName[0] == '.' || pszName[0] == '-')
     1439        pszName[0] = '_';
     1440
     1441    /* No trailing dot. */
     1442    if (pszName[strName.length() - 1] == '.')
     1443        pszName[strName.length() - 1] = '_';
     1444
     1445    /* Mangle leading and trailing spaces. */
     1446    for (size_t i = 0; pszName[i] == ' '; ++i)
     1447        pszName[i] = '_';
     1448    for (size_t i = strName.length() - 1; i && pszName[i] == ' '; --i)
     1449        pszName[i] = '_';
    14531450}
    14541451
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