VirtualBox

Changeset 36544 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 4, 2011 5:59:31 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70972
Message:

iprt-cpp: fix RTCString::join when the list contains just one item

Location:
trunk/src/VBox/Runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/ministring.cpp

    r36532 r36544  
    370370        for (size_t i = 0; i < a_rList.size() - 1; ++i)
    371371            strRet += a_rList.at(i) + a_rstrSep;
     372    }
     373    if (a_rList.size() > 0)
    372374        strRet += a_rList.last();
    373     }
    374375
    375376    return strRet;
  • trunk/src/VBox/Runtime/testcase/tstIprtMiniString.cpp

    r36532 r36544  
    282282    strTest = RTCString::join(jnList, "##");
    283283    RTTESTI_CHECK(strTest == "");
    284     for (size_t i = 0; i < 5; ++i)
     284    jnList.append("abcdef");
     285    strTest = RTCString::join(jnList, "##");
     286    RTTESTI_CHECK(strTest == "abcdef");
     287    for (size_t i = 0; i < 4; ++i)
    285288        jnList.append("abcdef");
    286289    strTest = RTCString::join(jnList);
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