From 168fceb8042d9db28cc4e690b2f3d6bea8a5bca2 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sun, 7 Apr 2002 00:18:37 +0000 Subject: [PATCH] perforce 2.4 integration [SVN r13390] --- src/util/doc.jam | 21 +++++++++++++-------- src/util/sequence.jam | 2 ++ src/util/string.jam | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/util/doc.jam b/src/util/doc.jam index 106e18b71..e04a9aad4 100644 --- a/src/util/doc.jam +++ b/src/util/doc.jam @@ -156,7 +156,7 @@ rule do-help ( ) # Is it a module? local path-to-modules = [ modules.peek : BOOST_BUILD_PATH ] ; path-to-modules ?= . ; - if $(help) && [ glob $(path-to-modules) : $(help)\\.jam ] + if $(help) && [ GLOB $(path-to-modules) : $(help)\\.jam ] { print-help-modules $(help) ; did-help = true ; @@ -260,7 +260,7 @@ rule print-help-modules ( modules * ) "detailed information." ; local modules-to-list = - [ glob [ modules.peek : BOOST_BUILD_PATH ] : *.jam ] ; + [ GLOB [ modules.peek : BOOST_BUILD_PATH ] : *.jam ] ; if $(modules-to-list) { print-list-start ; @@ -558,29 +558,34 @@ rule echo-with-wordwrap ( text + : indent ? ) { text = $(text:J=" ") ; indent ?= "" ; + local use-indent = "" ; local char-match = ".?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?" ; while $(text) { local s = "" ; local t = "" ; - s = [ MATCH "^($(char-match)).*" : $(text) ] ; - s += [ MATCH "^$(char-match)(.*)" : $(text) ] ; + # divide s into the first 78 characters and the rest + s = [ MATCH "^($(char-match))(.*)" : $(text) ] ; + if $(s[2]) { - t = [ MATCH "^(.*)[\\ ][^\\ ]*$" : $(s[1]) ] ; - t += [ MATCH "^.*[\\ ]([^\\ ]*)$" : $(s[1]) ] ; + # split the first half at a space + t = [ MATCH "^(.*)[\\ ]([^\\ ]*)$" : $(s[1]) ] ; } else { t = $(s) ; } + if ! $(t[2]) { t += "" ; } - text = $(indent)$(t[2])$(s[2]) ; - ECHO $(t[1]) ; + + text = $(t[2])$(s[2]) ; + ECHO $(use-indent)$(t[1]) ; + use-indent = $(indent) ; } } diff --git a/src/util/sequence.jam b/src/util/sequence.jam index 5fd5fa0cb..2f452b79f 100644 --- a/src/util/sequence.jam +++ b/src/util/sequence.jam @@ -197,6 +197,8 @@ local rule __test__ ( ) assert.result 1 : sequence.length a ; assert.result 10 : sequence.length a b c d e f g h i j ; + assert.result 11 : sequence.length a b c d e f g h i j k ; + assert.result 12 : sequence.length a b c d e f g h i j k l ; local p2 = x ; for local i in 1 2 3 4 5 6 7 8 diff --git a/src/util/string.jam b/src/util/string.jam index c0a034d30..fcabc3e75 100644 --- a/src/util/string.jam +++ b/src/util/string.jam @@ -15,7 +15,7 @@ rule chars ( string ) } # trim off empty strings - while $(result[1]) && ! $(result[-2]) + while $(result[1]) && ! $(result[-1]) { result = $(result[1--2]) ; }