Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-09-16 09:06:36


Johan Nilsson wrote:

> > 1. What's [.bin_vms]? Is it directory called ".bin_vms".
>
> Yes, subdirectory (to current directory) called 'bin_vms'.

Ok.

> > 2. What's []? Is the OpenVMS equvivalent of "." (current directory)?
>
> Yes.

Ok.

> > 3. What is printed if you run jam on the following code:
> >
> > p = [.bin_vms] ;
> > ECHO $(p) ;
> > p = $(p:P) ;
> > ECHO $(p) ;
> > p = $(p:P) ;
> > ECHO $(p) ;
> > p = $(p:P) ;
> > ECHO $(p) ;
>
> [.bin_vms]
> []
> []
> []
>
> (as expected?)

Yep, as expected, but probably not as desired. It is intuitive to assumed that
$(p:P) returns empty string if $(p) has no parent directory component. This
seems to be explicit decision in jam code, but no rationale is provided.

Could you please try applying the attached patch?

- Volodya
 --Boundary-00=_sjxZ/J0iDHJfTBA Content-Type: text/x-diff;
charset="iso-8859-1";
name="pathvms.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="pathvms.diff"

Index: pathvms.c
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/jam_src/pathvms.c,v
retrieving revision 1.4
diff -u -r1.4 pathvms.c
--- pathvms.c 6 Mar 2002 14:13:29 -0000 1.4
+++ pathvms.c 16 Sep 2003 14:05:59 -0000
@@ -313,7 +313,7 @@
* (none) (none)
* [dir1.dir2] [dir1]
* [dir] [000000]
- * [.dir] []
+ * [.dir] (none)
* [] []
*/

@@ -324,8 +324,14 @@
{
if( *p == '.' )
{
- string_truncate( file, p - file->value );
- string_push_back( file, ']' );
+ /* If we've truncated everything and left with '[',
+ return empty string. */
+ if (p == file->value + 1)
+ string_truncate( file, 0 );
+ else {
+ string_truncate( file, p - file->value );
+ string_push_back( file, ']' );
+ }
break;
}
else if( *p == '-' )
@@ -341,6 +347,8 @@
{
if( p[1] == ']' )
{
+ /* CONSIDER: I don't see any use of this code. We immediately
+ break, and 'p' is a local variable. */
p += 2;
}
else
 --Boundary-00=_sjxZ/J0iDHJfTBA--


Boost-Build 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