From 02a87e8e2e36912a6a849845b2bf0bb89cdae7a6 Mon Sep 17 00:00:00 2001 From: Stas Degteff Date: Sat, 19 Feb 2011 20:14:58 +0000 Subject: [PATCH] Fix MS VS 6.0 build, where string:clear() is not exist. Use one instanse of class string for all temporary strings --- goldlib/gall/gfilutl2.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/goldlib/gall/gfilutl2.cpp b/goldlib/gall/gfilutl2.cpp index 480cd68..da95f4f 100644 --- a/goldlib/gall/gfilutl2.cpp +++ b/goldlib/gall/gfilutl2.cpp @@ -127,7 +127,6 @@ int strschg_environ(std::string& s) { s.replace(posn, posn1-posn+1, rep); replaced++; } - fnd.clear(); } #ifndef __HAVE_DRIVES__ @@ -137,16 +136,16 @@ int strschg_environ(std::string& s) { if( (s.length() > 1) and not isslash(s[1]) ) { slash = s.find_first_of(GOLD_SLASH_STR GOLD_WRONG_SLASH_STR, 1); - std::string name(s,1,slash-1); - pe = getpwnam(name.c_str()); + fnd.assign(s,1,slash-1); + pe = getpwnam(fnd.c_str()); }else { pe = getpwuid(getuid()); } if(pe != NULL) { - std::string dirname = pe->pw_dir; + fnd.assign(pe->pw_dir); if ( slash != std::string::npos ) - dirname += s.substr(slash); - s=dirname; + fnd += s.substr(slash); + s=fnd; replaced++; } }