From f7d1660d80d442df9c20c43d56ec6fb5a777a24d Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 4 Jul 2005 16:47:58 +0000 Subject: [PATCH] windows_sucks++ , Daniel --- runtest.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/runtest.c b/runtest.c index 52dcf952..2b29d2f2 100644 --- a/runtest.c +++ b/runtest.c @@ -110,9 +110,22 @@ static int glob(const char *pattern, int flags, WIN32_FIND_DATA FindFileData; HANDLE hFind; unsigned int nb_paths = 0; + char directory[500], *tmp; + int len; if ((pattern == NULL) || (pglob == NULL)) return(-1); + strncpy(499, directory, pattern); + for (len = strlen(directory);len >= 0;len--) { + if (directory[len] == '/') { + directory[len + 1] = 0; + break; + } + } + if (len <= 0) + len = 0; + + ret = pglob; memset(ret, 0, sizeof(glob_t)); @@ -125,7 +138,8 @@ static int glob(const char *pattern, int flags, FindClose(hFind); return(-1); } - ret->gl_pathv[ret->gl_pathc] = strdup(FindFileData.cFileName); + strncpy(499 - len, directory + len, FindFileData.cFileName); + ret->gl_pathv[ret->gl_pathc] = strdup(directory); if (ret->gl_pathv[ret->gl_pathc] == NULL) goto done; ret->gl_pathc++; @@ -139,7 +153,8 @@ static int glob(const char *pattern, int flags, ret->gl_pathv = tmp; nb_paths *= 2; } - ret->gl_pathv[ret->gl_pathc] = strdup(FindFileData.cFileName); + strncpy(499 - len, directory + len, FindFileData.cFileName); + ret->gl_pathv[ret->gl_pathc] = strdup(directory); if (ret->gl_pathv[ret->gl_pathc] == NULL) break; ret->gl_pathc++; @@ -3710,7 +3725,6 @@ testThread(void) xmlLoadCatalog(catalog); nb_tests++; - nb_tests++; for (i = 0; i < num_threads; i++) { results[i] = NULL; tid[i] = (pthread_t) - 1; @@ -3769,6 +3783,7 @@ testThread(void) xmlInitParser(); for (repeat = 0; repeat < TEST_REPEAT_COUNT; repeat++) { xmlLoadCatalog(catalog); + nb_tests++; for (i = 0; i < num_threads; i++) { results[i] = 0;