From ba0a37f62b24ef7727145c0794d32e203ca8f5f4 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] --- src/engine/expand.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/engine/expand.c b/src/engine/expand.c index 5453851b9..ae14613ba 100644 --- a/src/engine/expand.c +++ b/src/engine/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"); }