|
Boost-Commit : |
From: grafikrobot_at_[hidden]
Date: 2007-09-17 17:36:00
Author: grafik
Date: 2007-09-17 17:35:58 EDT (Mon, 17 Sep 2007)
New Revision: 39357
URL: http://svn.boost.org/trac/boost/changeset/39357
Log:
Handle invalid formats of @() as doing a straight substitution instead of erroring out.
Text files modified:
trunk/tools/jam/src/variable.c | 16 +++++++++++++---
trunk/tools/jam/test/test.sh | 2 +-
trunk/tools/jam/test/var_expand.jam | 3 ++-
3 files changed, 16 insertions(+), 5 deletions(-)
Modified: trunk/tools/jam/src/variable.c
==============================================================================
--- trunk/tools/jam/src/variable.c (original)
+++ trunk/tools/jam/src/variable.c 2007-09-17 17:35:58 EDT (Mon, 17 Sep 2007)
@@ -242,11 +242,21 @@
if (!split)
{
- printf( "no file specified!\n" );
- exit( EXITBAD );
+ /* the @() reference doesn't match the @(foo:E=bar) format.
+ hence we leave it alone by copying directly to output. */
+ int l = 0;
+ if ( out+2 >= oute ) return -1;
+ *(out++) = '@';
+ *(out++) = '(';
+ l = var_string(in+2,out,oute-out,lol);
+ if ( l < 0 ) return -1;
+ out += l;
+ if ( out+1 >= oute ) return -1;
+ *(out++) = ')';
+ in = ine;
}
- if ( depth == 0 )
+ else if ( depth == 0 )
{
string file_name_v;
int file_name_l = 0;
Modified: trunk/tools/jam/test/test.sh
==============================================================================
--- trunk/tools/jam/test/test.sh (original)
+++ trunk/tools/jam/test/test.sh 2007-09-17 17:35:58 EDT (Mon, 17 Sep 2007)
@@ -6,4 +6,4 @@
BJAM=`ls -1 ../src/bin.*/bjam`
-${BJAM} -f test.jam
+${BJAM} -f test.jam "$*"
Modified: trunk/tools/jam/test/var_expand.jam
==============================================================================
--- trunk/tools/jam/test/var_expand.jam (original)
+++ trunk/tools/jam/test/var_expand.jam 2007-09-17 17:35:58 EDT (Mon, 17 Sep 2007)
@@ -15,4 +15,5 @@
assert dir : (==) : $(p1:D) ;
assert dir/sub : (==) : $(p2:D) ;
assert "" : (==) : $(p0:S) ;
-assert "@(.*)" : (==) : @(.*) ;
+assert ($(p0)) : (==) : [ MATCH ^@(.*) : "@($(p0))" ] ;
+assert ($(p0)) : (==) : [ MATCH @(.*) : "--@($(p0))" ] ;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk