From b38765970e0ba2622991d944fc0ea14fde724def Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 6 Dec 2005 20:18:22 +0000 Subject: [PATCH] Fix the CYGWIN path unit test, again. [SVN r31940] --- historic/jam/src/expand.c | 13 ++++++------- jam_src/expand.c | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/historic/jam/src/expand.c b/historic/jam/src/expand.c index 5453851b9..ae14613ba 100644 --- a/historic/jam/src/expand.c +++ b/historic/jam/src/expand.c @@ -15,6 +15,7 @@ # ifdef OS_CYGWIN # include # include +# include # endif /* @@ -685,14 +686,12 @@ void var_expand_unit_test() # ifdef OS_CYGWIN char cygpath[256]; { - char P[] = "$(PATH[1])"; - char * slash = 0; - l = var_expand( 0, P, P+sizeof(P)-1, lol, 0 ); - assert(l != 0); - slash = strchr(l->string+1,'/'); + const char * P = getenv("PATH"); + const char * slash = 0; + slash = strchr(P+1,'/'); assert(slash != 0); - strncpy(cygpath,l->string,slash-l->string+1); - cygpath[slash-l->string+1] = '\0'; + strncpy(cygpath,P,slash-P+1); + cygpath[slash-P+1] = '\0'; assert(strlen(cygpath) < 246); strcat(cygpath,"c/foo/bar"); } diff --git a/jam_src/expand.c b/jam_src/expand.c index 5453851b9..ae14613ba 100644 --- a/jam_src/expand.c +++ b/jam_src/expand.c @@ -15,6 +15,7 @@ # ifdef OS_CYGWIN # include # include +# include # endif /* @@ -685,14 +686,12 @@ void var_expand_unit_test() # ifdef OS_CYGWIN char cygpath[256]; { - char P[] = "$(PATH[1])"; - char * slash = 0; - l = var_expand( 0, P, P+sizeof(P)-1, lol, 0 ); - assert(l != 0); - slash = strchr(l->string+1,'/'); + const char * P = getenv("PATH"); + const char * slash = 0; + slash = strchr(P+1,'/'); assert(slash != 0); - strncpy(cygpath,l->string,slash-l->string+1); - cygpath[slash-l->string+1] = '\0'; + strncpy(cygpath,P,slash-P+1); + cygpath[slash-P+1] = '\0'; assert(strlen(cygpath) < 246); strcat(cygpath,"c/foo/bar"); }