From 7e5a4dfb2817b3549a3f7ab5b2b71b41ce704865 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Wed, 27 Oct 2004 11:22:02 +0000 Subject: [PATCH] Improved regular expression for removing pairs from command-line strings. (Wayne Lee) git-svn-id: http://scons.tigris.org/svn/scons/trunk@1144 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- 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 579811e7..d9a397f3 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 b713b570..b2bae65e 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 ] -- 2.26.2