diff --git a/src/tools/rc.jam b/src/tools/rc.jam index ef4ef6e859..70fabd4536 100644 --- a/src/tools/rc.jam +++ b/src/tools/rc.jam @@ -93,6 +93,7 @@ class res-scanner : scanner import path ; import regex ; import scanner ; + import sequence ; import toolset ; import virtual-target ; @@ -108,13 +109,15 @@ class res-scanner : scanner rule pattern ( ) { - return "(([^ ]+[ ]+(BITMAP|CURSOR|FONT|ICON|MESSAGETABLE|RT_MANIFEST)[ ]+([^ \"]+|\"[^\"]+\"))|(#include[ ]*(<[^<]+>|\"[^\"]+\")))" ; + return "(([^ ]+[ ]+(BITMAP|CURSOR|FONT|ICON|MESSAGETABLE|RT_MANIFEST)[ ]+([^ \"]+|\"[^\"]+\"))|(^[ \t]*#[ \t]*include[ \t]*(<[^<]+>|\"[^\"]+\")))" ; } rule process ( target : matches * : binding ) { - local angle = [ regex.transform $(matches) : "#include[ ]*<([^<]+)>" ] ; - local quoted = [ regex.transform $(matches) : "#include[ ]*\"([^\"]+)\"" ] ; + local angle = [ regex.transform $(matches) : "#include[ \t]*<([^<]+)>" ] ; + angle = [ sequence.transform path.native : $(angle) ] ; + local quoted = [ regex.transform $(matches) : "#include[ \t]*\"([^\"]+)\"" ] ; + quoted = [ sequence.transform path.native : $(quoted) ] ; local res = [ regex.transform $(matches) : "[^ ]+[ ]+(BITMAP|CURSOR|FONT|ICON|MESSAGETABLE|RT_MANIFEST)[ ]+(([^ \"]+)|\"([^\"]+)\")" : 3 4 ] ; # Icons and other includes may be referenced as diff --git a/src/tools/types/cpp.jam b/src/tools/types/cpp.jam index c2ab01fdf7..af8bf2b09f 100644 --- a/src/tools/types/cpp.jam +++ b/src/tools/types/cpp.jam @@ -30,14 +30,14 @@ class c-scanner : scanner rule pattern ( ) { - return "^[ \t]*#[ \t]*include[ \t]*(<(.+)>|\"(.+)\")" ; + return "^[ \t]*#[ \t]*include[ \t]*(<[^<]+>|\"[^\"]+\")" ; } rule process ( target : matches * : binding ) { - local angle = [ regex.transform $(matches) : "<(.*)>" ] ; + local angle = [ regex.transform $(matches) : "<([^<]+)>" ] ; angle = [ sequence.transform path.native : $(angle) ] ; - local quoted = [ regex.transform $(matches) : "\"(.*)\"" ] ; + local quoted = [ regex.transform $(matches) : "\"([^\"]+)\"" ] ; quoted = [ sequence.transform path.native : $(quoted) ] ; # CONSIDER: the new scoping rules seem to defeat "on target" variables. diff --git a/src/tools/types/objc.jam b/src/tools/types/objc.jam index 7d6ce0cbf3..81a58abd81 100644 --- a/src/tools/types/objc.jam +++ b/src/tools/types/objc.jam @@ -14,7 +14,7 @@ class objc-scanner : c-scanner rule pattern ( ) { - return "^[ \t]*#[ \t]*include|import[ ]*(<(.+)>|\"(.+)\")" ; + return "^[ \t]*#[ \t]*(include|import)[ \t]*(<[^<]+>|\"[^\"]+\")" ; } }