From 774787a9fbb956e32cce7080832d4ca563ced146 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Mon, 16 Jun 2003 12:13:38 +0000 Subject: [PATCH] Robustify 'print' module a little: print.text works okay even if empty list of strings is passed. [SVN r18799] --- new/print.jam | 9 ++++++--- v2/util/print.jam | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/new/print.jam b/new/print.jam index d58bc47e2..db35bb741 100644 --- a/new/print.jam +++ b/new/print.jam @@ -311,13 +311,16 @@ rule text ( } } } - else if $(output-target) + # Don't do anything if 'strings' is empty. + # Otherwise, no actions will be created for + # 'body' target, and bjam will say it can't update it + else if $(output-target) && $(strings) { - local rule get-locate ( ) { return $(LOCATE) ; } $(output-target).line ?= 0 ; DEPENDS $(output-target) : $(output-target:G=body) ; ALWAYS $(output-target:G=body) ; - LOCATE on $(output-target:G=body) = [ on $(output-target) get-locate ] ; + LOCATE on $(output-target:G=body) = + [ on $(output-target) return $(LOCATE) ] ; while $(strings) { local line-v = $(output-target).line.$($(output-target).line) ; diff --git a/v2/util/print.jam b/v2/util/print.jam index d58bc47e2..db35bb741 100644 --- a/v2/util/print.jam +++ b/v2/util/print.jam @@ -311,13 +311,16 @@ rule text ( } } } - else if $(output-target) + # Don't do anything if 'strings' is empty. + # Otherwise, no actions will be created for + # 'body' target, and bjam will say it can't update it + else if $(output-target) && $(strings) { - local rule get-locate ( ) { return $(LOCATE) ; } $(output-target).line ?= 0 ; DEPENDS $(output-target) : $(output-target:G=body) ; ALWAYS $(output-target:G=body) ; - LOCATE on $(output-target:G=body) = [ on $(output-target) get-locate ] ; + LOCATE on $(output-target:G=body) = + [ on $(output-target) return $(LOCATE) ] ; while $(strings) { local line-v = $(output-target).line.$($(output-target).line) ;