Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78575 - trunk/tools/build/v2/engine
From: jurko.gospodnetic_at_[hidden]
Date: 2012-05-24 05:53:24


Author: jurko
Date: 2012-05-24 05:53:24 EDT (Thu, 24 May 2012)
New Revision: 78575
URL: http://svn.boost.org/trac/boost/changeset/78575

Log:
Fixed Boost Jam crash when the SPLIT_BY_CHARACTERS rule gets passed an empty list as any of its arguments.
Text files modified:
   trunk/tools/build/v2/engine/builtins.c | 8 ++++++--
   1 files changed, 6 insertions(+), 2 deletions(-)

Modified: trunk/tools/build/v2/engine/builtins.c
==============================================================================
--- trunk/tools/build/v2/engine/builtins.c (original)
+++ trunk/tools/build/v2/engine/builtins.c 2012-05-24 05:53:24 EDT (Thu, 24 May 2012)
@@ -947,12 +947,16 @@
     
     string buf[ 1 ];
 
- const char * delimiters = object_str( list_front( l2 ) );
+ const char * delimiters;
     char * t;
 
+ if ( list_empty( l1 ) || list_empty( l2 ) )
+ return L0;
+
     string_copy( buf, object_str( list_front( l1 ) ) );
+ delimiters = object_str( list_front( l2 ) );
 
- t = strtok( buf->value, delimiters) ;
+ t = strtok( buf->value, delimiters ) ;
     while ( t )
     {
         result = list_push_back( result, object_new( t ) );


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