Improved regular expression for removing pairs from command-line strings. (Wayne...
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 27 Oct 2004 11:22:02 +0000 (11:22 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 27 Oct 2004 11:22:02 +0000 (11:22 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1144 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Util.py

index 579811e7a1fa0c51e7a8d65ac13a11cb703b78c0..d9a397f30834b82b8a5606a8e11bfbc5997b9238 100644 (file)
@@ -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
index b713b570a72a462173bd54f33bc3115cca226726..b2bae65e593740a2022472db73ca3dbd45e75aae 100644 (file)
@@ -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 ]