diff --git a/src/xpdev/dirwrap.c b/src/xpdev/dirwrap.c
index 1907840e16fd2701172be7a7093db7e9bfc5066e..a6dc042928e9ddd0de309658d29ea3a55ffa7f8b 100644
--- a/src/xpdev/dirwrap.c
+++ b/src/xpdev/dirwrap.c
@@ -416,13 +416,13 @@ BOOL DLLCALL fexistcase(char *path)
 	if(glob(globme,GLOB_MARK|GLOB_NOSORT,NULL,&glb))
 		return(FALSE);
 	
-	if(glb.gl_matchc>0)  {
+	if(glb.gl_pathc>0)  {
 		/**********************************************************
 		 * If multiple matches are found, return TRUE only if one *
 		 * EXACTLY matches path or all but one are directories	  *
 		 **********************************************************/
 		j=-1;
-		for(i=0;i<glb.gl_matchc;i++)  {
+		for(i=0;i<glb.gl_pathc;i++)  {
 			if(!strcmp(path,glb.gl_pathv[i]))  {
 				globfree(&glb);
 				return TRUE;