mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
windows_sucks++ , Daniel
This commit is contained in:
21
runtest.c
21
runtest.c
@@ -110,9 +110,22 @@ static int glob(const char *pattern, int flags,
|
|||||||
WIN32_FIND_DATA FindFileData;
|
WIN32_FIND_DATA FindFileData;
|
||||||
HANDLE hFind;
|
HANDLE hFind;
|
||||||
unsigned int nb_paths = 0;
|
unsigned int nb_paths = 0;
|
||||||
|
char directory[500], *tmp;
|
||||||
|
int len;
|
||||||
|
|
||||||
if ((pattern == NULL) || (pglob == NULL)) return(-1);
|
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;
|
ret = pglob;
|
||||||
memset(ret, 0, sizeof(glob_t));
|
memset(ret, 0, sizeof(glob_t));
|
||||||
|
|
||||||
@@ -125,7 +138,8 @@ static int glob(const char *pattern, int flags,
|
|||||||
FindClose(hFind);
|
FindClose(hFind);
|
||||||
return(-1);
|
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)
|
if (ret->gl_pathv[ret->gl_pathc] == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
ret->gl_pathc++;
|
ret->gl_pathc++;
|
||||||
@@ -139,7 +153,8 @@ static int glob(const char *pattern, int flags,
|
|||||||
ret->gl_pathv = tmp;
|
ret->gl_pathv = tmp;
|
||||||
nb_paths *= 2;
|
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)
|
if (ret->gl_pathv[ret->gl_pathc] == NULL)
|
||||||
break;
|
break;
|
||||||
ret->gl_pathc++;
|
ret->gl_pathc++;
|
||||||
@@ -3710,7 +3725,6 @@ testThread(void)
|
|||||||
xmlLoadCatalog(catalog);
|
xmlLoadCatalog(catalog);
|
||||||
nb_tests++;
|
nb_tests++;
|
||||||
|
|
||||||
nb_tests++;
|
|
||||||
for (i = 0; i < num_threads; i++) {
|
for (i = 0; i < num_threads; i++) {
|
||||||
results[i] = NULL;
|
results[i] = NULL;
|
||||||
tid[i] = (pthread_t) - 1;
|
tid[i] = (pthread_t) - 1;
|
||||||
@@ -3769,6 +3783,7 @@ testThread(void)
|
|||||||
xmlInitParser();
|
xmlInitParser();
|
||||||
for (repeat = 0; repeat < TEST_REPEAT_COUNT; repeat++) {
|
for (repeat = 0; repeat < TEST_REPEAT_COUNT; repeat++) {
|
||||||
xmlLoadCatalog(catalog);
|
xmlLoadCatalog(catalog);
|
||||||
|
nb_tests++;
|
||||||
|
|
||||||
for (i = 0; i < num_threads; i++) {
|
for (i = 0; i < num_threads; i++) {
|
||||||
results[i] = 0;
|
results[i] = 0;
|
||||||
|
Reference in New Issue
Block a user