From 490b9b0e0e37518174fcd90a5a10f2f888bf8941 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 2 Dec 2017 17:35:36 +0000 Subject: [PATCH] Fixed string parsing and substituion bugs isn substitudeEnvVars(..) --- src/osg/State.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/osg/State.cpp b/src/osg/State.cpp index ba9e143e5..031f34872 100644 --- a/src/osg/State.cpp +++ b/src/osg/State.cpp @@ -1249,15 +1249,19 @@ namespace State_Utils if (str[pos]=='"' || str[pos]=='\'') { std::string::size_type start_quote = pos; - ++pos; + ++pos; // skip over first quote pos = str.find(str[start_quote], pos); + + if (pos!=std::string::npos) + { + ++pos; // skip over second quote + } } else { std::string::size_type start_var = pos; ++pos; pos = str.find_first_not_of("ABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_", pos); - std::string var_str; if (pos != std::string::npos) {