fix extra substring checks being performed on systems that don't do Q172398

This commit is contained in:
Glenn Maynard
2005-09-02 19:11:25 +00:00
parent ac39d8ef1f
commit afcb57fd60
+6
View File
@@ -276,6 +276,7 @@ typedef char* PSTR;
// (basic_string assignment bug) // (basic_string assignment bug)
#if defined ( _MSC_VER ) && ( _MSC_VER < 1200 ) #if defined ( _MSC_VER ) && ( _MSC_VER < 1200 )
#define HAVE_ASSIGN_FIX
#define Q172398(x) (x).erase() #define Q172398(x) (x).erase()
#else #else
#define Q172398(x) #define Q172398(x)
@@ -351,6 +352,7 @@ inline void ssasn(std::string& sDst, PCSTR pA)
sDst.erase(); sDst.erase();
} }
#if defined(HAVE_ASSIGN_FIX)
// If pA actually points to part of sDst, we must NOT erase(), but // If pA actually points to part of sDst, we must NOT erase(), but
// rather take a substring // rather take a substring
@@ -367,6 +369,10 @@ inline void ssasn(std::string& sDst, PCSTR pA)
Q172398(sDst); Q172398(sDst);
sDst.assign(pA); sDst.assign(pA);
} }
#else
else
sDst.assign(pA);
#endif
} }
inline void ssasn(std::string& sDst, const int nNull) inline void ssasn(std::string& sDst, const int nNull)
{ {