VirtualBox

Changeset 67963 in vbox for trunk/src/VBox/Runtime/r3


Ignore:
Timestamp:
Jul 14, 2017 12:43:28 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
116963
Message:

RTNtPathFromWinUtf16Ex: Remove special trailing dot.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/nt/pathint-nt.cpp

    r64640 r67963  
    350350    {
    351351        /*
    352          * Add prefix and convert it to UTF16.
     352         * Add prefix
    353353         */
    354354        memcpy(szAbsPath, pszPrefix, cchPrefix);
     355
     356        /*
     357         * Remove trailing '.' that is used to specify no extension in the Win32/DOS world.
     358         */
     359        size_t cchAbsPath = strlen(szAbsPath);
     360        if (   cchAbsPath > 2
     361            && szAbsPath[cchAbsPath - 1] == '.')
     362        {
     363            char const ch = szAbsPath[cchAbsPath - 2];
     364            if (   ch != '/'
     365                && ch != '\\'
     366                && ch != ':'
     367                && ch != '.')
     368                szAbsPath[--cchAbsPath] = '\0';
     369        }
     370
     371        /*
     372         * Finally convert to UNICODE_STRING.
     373         */
    355374        return rtNtPathUtf8ToUniStr(pNtName, phRootDir, szAbsPath);
    356375    }
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