Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-01-31 19:46:51


Author: jurko
Date: 2008-01-31 19:46:50 EST (Thu, 31 Jan 2008)
New Revision: 43045
URL: http://svn.boost.org/trac/boost/changeset/43045

Log:
Corrected outputting native Windows paths so that it works correctly for absolute paths without the drive letter being explicitly specified, e.g. \aaa\bbb or /aaa/bbb.
Text files modified:
   trunk/tools/build/v2/util/path.jam | 13 ++++++++++++-
   1 files changed, 12 insertions(+), 1 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-01-31 19:46:50 EST (Thu, 31 Jan 2008)
@@ -475,7 +475,15 @@
 
 rule native-NT ( path )
 {
- local result = [ MATCH "^/?(.*)" : $(path) ] ;
+ local result ;
+ if [ is-rooted $(path) ] && ! [ regex.match "^/(.:)" : $(path) ]
+ {
+ result = $(path) ;
+ }
+ else
+ {
+ result = [ MATCH "^/?(.*)" : $(path) ] ;
+ }
     result = [ sequence.join [ regex.split $(result) "/" ] : "\\" ] ;
     return $(result) ;
 }
@@ -761,11 +769,14 @@
     assert.result "foo/bar/giz" : make "foo\\bar\\giz" ;
     assert.result "foo" : make "foo/." ;
     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" ;
     assert.result "/c:/boost/tools/build/new/project.jam" : make "c:\\boost\\tools\\build\\test\\..\\new\\project.jam" ;
 
     assert.result "foo\\bar\\giz" : native "foo/bar/giz" ;
     assert.result "foo" : native "foo" ;
+ assert.result "\\foo" : native "/foo" ;
     assert.result "D:\\My Documents\\Work" : native "/D:/My Documents/Work" ;
 
     modules.poke path : os : UNIX ;


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