VirtualBox

Changeset 33805 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 5, 2010 5:17:16 PM (14 years ago)
Author:
vboxsync
Message:

iprt::MiniString: Added a substring constructor and joined the copyFrom stuff into one common method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/string.cpp

    r33621 r33805  
    7474    if (length())
    7575    {
    76         char *pcszFilename = ::RTStrDup(::RTPathFilename(m_psz));
    77         cleanup();
    78         MiniString::copyFrom(pcszFilename);
    79         RTStrFree(pcszFilename);
     76        char *pszName = ::RTPathFilename(m_psz);
     77        if (pszName)
     78        {
     79            size_t cchName = length() - (pszName - m_psz);
     80            memmove(m_psz, pszName, cchName + 1);
     81            jolt();
     82        }
     83        else
     84            cleanup();
    8085    }
    8186    return *this;
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