From 8c8b42afc41c877199c00ad4b9cdb127bc312d9d Mon Sep 17 00:00:00 2001 From: Stas Degteff Date: Wed, 7 Dec 2005 18:25:05 +0000 Subject: [PATCH] Fix enviroment variables substitution. (Bugreport from Yaroslav Tchayckovsky 2:5076/14) --- goldlib/gall/gfilutl2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goldlib/gall/gfilutl2.cpp b/goldlib/gall/gfilutl2.cpp index 7b04c7b..0679838 100644 --- a/goldlib/gall/gfilutl2.cpp +++ b/goldlib/gall/gfilutl2.cpp @@ -77,7 +77,7 @@ int strschg_environ(std::string& s) { size_t posn, posn1; while(((posn=s.find('%')) != s.npos) and ((posn1=s.find('%', posn+1)) != s.npos)) { - fnd = s.substr(posn+1, posn1-1); + fnd = s.substr(posn+1, posn1-1-posn); const char* rep = getenv(fnd.c_str()); rep = rep ? rep : ""; s.replace(posn, posn1-posn+1, rep);