From dd9a6d52a84c445b7516fc80b72f2baa3bc8b937 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Wed, 27 Oct 2004 11:22:02 +0000 Subject: Improved regular expression for removing pairs from command-line strings. (Wayne Lee) --- src/CHANGES.txt | 5 +++++ src/engine/SCons/Util.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 579811e..d9a397f 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -113,6 +113,11 @@ RELEASE 0.97 - XXX for another target, to avoid trying to build it again when it comes up in the target list. + From Wayne Lee: + + - Avoid "maximum recursion limit" errors when removing $(-$) pairs + from long command lines. + From Clive Levinson: - Make ParseConfig() recognize and add -mno-cygwin to $LINKFLAGS and diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index b713b57..b2bae65 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -509,7 +509,7 @@ SUBST_RAW = 1 SUBST_SIG = 2 _rm = re.compile(r'\$[()]') -_remove = re.compile(r'\$\(([^\$]|\$[^\(])*?\$\)') +_remove = re.compile(r'\$\([^\$]*(\$[^\)][^\$]*)*\$\)') # Indexed by the SUBST_* constants above. _regex_remove = [ _rm, None, _remove ] -- cgit v0.12