Index: expand.c =================================================================== RCS file: /cvsroot/boost/boost/tools/build/jam_src/expand.c,v retrieving revision 1.10 diff -b -d -u -b -u -r1.10 expand.c --- expand.c 12 Feb 2005 02:30:16 -0000 1.10 +++ expand.c 3 Nov 2005 15:43:01 -0000 @@ -634,14 +634,43 @@ * var_edit_shift() - do upshift/downshift mods */ +static char cygdrive[] = "/cygdrive/"; + static void var_edit_shift( string *out, VAR_EDITS *edits ) { /* Handle upshifting, downshifting and slash translation now */ - char *p; + + if ( edits->to_windows ) + { +# ifdef OS_CYGWIN + char result[MAX_PATH + 1]; + cygwin_conv_to_win32_path(out->value, result); + assert(strlen(result) <= MAX_PATH); + string_free( out ); + string_copy( out, result ); +# else + +# define DRIVELETTER (sizeof(cygdrive) - 1) + if (!strncmp(out->value, cygdrive, sizeof(cygdrive) - 1) + && out->value[DRIVELETTER] + && out->value[DRIVELETTER + 1] == '/' + ) + { + out->value[0] = out->value[DRIVELETTER]; + out->value[1] = ':'; + memmove( + out->value + 2 + , out->value + DRIVELETTER + 1, (out->size + 1) - (DRIVELETTER + 1) + ); + out->size -= DRIVELETTER - 1; /* leaving room for the colon */ + } + } +# endif + for ( p = out->value; *p; ++p) { if (edits->upshift) @@ -657,17 +686,14 @@ if ( *p == '\\') *p = '/'; } -# ifdef OS_CYGWIN if ( edits->to_windows ) { - char result[MAX_PATH + 1]; - cygwin_conv_to_win32_path(out->value, result); - assert(strlen(result) <= MAX_PATH); - string_free( out ); - string_copy( out, result ); - } +# ifndef OS_CYGWIN + if (*p == '/') + *p = '\\'; # endif } + } out->size = p - out->value; } @@ -702,11 +728,7 @@ l = var_expand( 0, path, path + sizeof(path) - 1, lol, 0 ); assert(l != 0); assert(list_next(l) == 0); -# ifdef OS_CYGWIN assert( !strcmp( l->string, "c:\\foo\\bar" ) ); -# else - assert( !strcmp( l->string, "/cygdrive/c/foo/bar" ) ); -# endif list_free(l); list_free(expected);