aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2001-02-03 01:17:13 +0000
committernyamatongwe <devnull@localhost>2001-02-03 01:17:13 +0000
commitef6dc6d0a92c752a507eca6d1bc954279fe3c7fd (patch)
tree9d2d53413c0fc22b2cc71d4083a43b83134969a4
parent4b0714b4ede030cbadced1bc8015f87de429338a (diff)
downloadscintilla-mirror-ef6dc6d0a92c752a507eca6d1bc954279fe3c7fd.tar.gz
Fixed infinite recursion when a value contains a reference to itself.
-rw-r--r--src/PropSet.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/PropSet.cxx b/src/PropSet.cxx
index 2799e3c3e..61aa7e169 100644
--- a/src/PropSet.cxx
+++ b/src/PropSet.cxx
@@ -96,6 +96,16 @@ SString PropSet::Get(const char *key) {
SString PropSet::GetExpanded(const char *key) {
SString val = Get(key);
+ const char *var = strstr(val.c_str(), "$(");
+ while (var) {
+ if (isprefix(var+2, key) && (var[2 + strlen(key)] == ')')) {
+ // Found $(key) which would lead to an infinite loop so exit
+ return val;
+ }
+ var = strstr(var + 2, ")");
+ if (var)
+ var = strstr(var + 1, "$(");
+ }
return Expand(val.c_str());
}