Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-05-03 13:22:08


Author: jurko
Date: 2008-05-03 13:22:08 EDT (Sat, 03 May 2008)
New Revision: 45079
URL: http://svn.boost.org/trac/boost/changeset/45079

Log:
Made it clear that Boost Build's Windows path handling does not handle paths with multiple successive path separator characters. Added several missing internal path.jam module tests. Minor stylistic changes.
Text files modified:
   trunk/tools/build/v2/util/path.jam | 18 ++++++++++++++----
   1 files changed, 14 insertions(+), 4 deletions(-)

Modified: trunk/tools/build/v2/util/path.jam
==============================================================================
--- trunk/tools/build/v2/util/path.jam (original)
+++ trunk/tools/build/v2/util/path.jam 2008-05-03 13:22:08 EDT (Sat, 03 May 2008)
@@ -169,7 +169,7 @@
 
 
 # Concatenates the passed path elements. Generates an error if any element other
-# than the first one is rooted.
+# than the first one is rooted. Path elements are not allowed to be undefined.
 #
 rule join ( elements + )
 {
@@ -195,9 +195,12 @@
 #
 rule root ( path root )
 {
- if [ is-rooted $(path) ] {
+ if [ is-rooted $(path) ]
+ {
         return $(path) ;
- } else {
+ }
+ else
+ {
         return [ join $(root) $(path) ] ;
     }
 }
@@ -447,12 +450,15 @@
 }
 
 
+# This rule does not support 'invalid' paths containing multiple successive
+# path separator characters.
+#
 rule make-NT ( native )
 {
     local tokens = [ regex.split $(native) "[/\\]" ] ;
     local result ;
 
- # Handle paths ending with slashes.
+ # Handle paths ending with a slash.
     if $(tokens[-1]) = ""
     {
         tokens = $(tokens[1--2]) ; # Discard the empty element.
@@ -768,8 +774,12 @@
 
     assert.result "foo/bar/giz" : make "foo/bar/giz" ;
     assert.result "foo/bar/giz" : make "foo\\bar\\giz" ;
+ assert.result "foo" : make "foo/" ;
+ assert.result "foo" : make "foo\\" ;
     assert.result "foo" : make "foo/." ;
     assert.result "foo" : make "foo/bar/.." ;
+ assert.result "foo" : make "foo/bar/../" ;
+ assert.result "foo" : make "foo/bar/..\\" ;
     assert.result "foo/bar" : make "foo/././././bar" ;
     assert.result "/foo" : make "\\foo" ;
     assert.result "/D:/My Documents" : make "D:\\My Documents" ;


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