Boost logo

Boost-Build :

From: John Maddock (john_at_[hidden])
Date: 2006-01-27 06:09:12


> There's code in the var_expand_unit_test that tries to verify the
> functionality of expanding paths. In the case of Cygwin it wants to
> check that something like "/cygdrive/c/foo/bar" is translated to
> something like "c:\foo\bar". The problem comes in that the "/cygdrive"
> part is a user configurable path on Cygwin. I wrote code that tries to
> decipher what that 'cygdrive' is, as there doesn't seem to be any
> Cygwin call to get that value. Unfortunately, or fortunately from my
> POV, I don't have Cygwin to test with. So any help in getting that
> code working is appreciated ;-)

Patch below, note that using the $PATH to get at the /cygdrive name is a
non-starter as /usr/bin is the first value in there (for me at least).

OK to commit?

John.

Index: expand.c
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/jam_src/expand.c,v
retrieving revision 1.12
diff -u -r1.12 expand.c
--- expand.c 6 Dec 2005 20:18:22 -0000 1.12
+++ expand.c 27 Jan 2006 11:06:30 -0000
@@ -685,16 +685,7 @@

     # ifdef OS_CYGWIN
     char cygpath[256];
- {
- const char * P = getenv("PATH");
- const char * slash = 0;
- slash = strchr(P+1,'/');
- assert(slash != 0);
- strncpy(cygpath,P,slash-P+1);
- cygpath[slash-P+1] = '\0';
- assert(strlen(cygpath) < 246);
- strcat(cygpath,"c/foo/bar");
- }
+ cygwin_conv_to_posix_path("c:\\foo\\bar", cygpath);
     # else
     char cygpath[] = "/cygdrive/c/foo/bar";
     # endif


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