From afcb57fd60268142beb282c5c0fac103d8fc4def Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 2 Sep 2005 19:11:25 +0000 Subject: [PATCH] fix extra substring checks being performed on systems that don't do Q172398 --- stepmania/src/StdString.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stepmania/src/StdString.h b/stepmania/src/StdString.h index b743222f18..395e869b78 100644 --- a/stepmania/src/StdString.h +++ b/stepmania/src/StdString.h @@ -276,6 +276,7 @@ typedef char* PSTR; // (basic_string assignment bug) #if defined ( _MSC_VER ) && ( _MSC_VER < 1200 ) + #define HAVE_ASSIGN_FIX #define Q172398(x) (x).erase() #else #define Q172398(x) @@ -351,6 +352,7 @@ inline void ssasn(std::string& sDst, PCSTR pA) sDst.erase(); } +#if defined(HAVE_ASSIGN_FIX) // If pA actually points to part of sDst, we must NOT erase(), but // rather take a substring @@ -367,6 +369,10 @@ inline void ssasn(std::string& sDst, PCSTR pA) Q172398(sDst); sDst.assign(pA); } +#else + else + sDst.assign(pA); +#endif } inline void ssasn(std::string& sDst, const int nNull) {