This repository was archived by the owner on Oct 13, 2020. It is now read-only.
File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -76,24 +76,23 @@ collect_tests_from_dir (char (*paths)[MAX_TEST_NAME_LENGTH] /* OUT */,
76
76
int max_paths )
77
77
{
78
78
#ifdef _MSC_VER
79
+ char * dir_path_plus_star ;
79
80
intptr_t handle ;
80
81
struct _finddata_t info ;
81
82
82
83
char child_path [MAX_TEST_NAME_LENGTH ];
83
84
84
- handle = _findfirst (dir_path , & info );
85
+ dir_path_plus_star = bson_strdup_printf ("%s/*" , dir_path );
86
+ handle = _findfirst (dir_path_plus_star , & info );
85
87
86
88
if (handle == -1 ) {
89
+ bson_free (dir_path_plus_star );
87
90
return 0 ;
88
91
}
89
92
90
93
while (1 ) {
91
94
BSON_ASSERT (paths_index < max_paths );
92
95
93
- if (_findnext (handle , & info ) == -1 ) {
94
- break ;
95
- }
96
-
97
96
if (info .attrib & _A_SUBDIR ) {
98
97
/* recursively call on child directories */
99
98
if (strcmp (info .name , ".." ) != 0 && strcmp (info .name , "." ) != 0 ) {
@@ -105,8 +104,13 @@ collect_tests_from_dir (char (*paths)[MAX_TEST_NAME_LENGTH] /* OUT */,
105
104
/* if this is a JSON test, collect its path */
106
105
assemble_path (dir_path , info .name , paths [paths_index ++ ]);
107
106
}
107
+
108
+ if (_findnext (handle , & info ) == -1 ) {
109
+ break ;
110
+ }
108
111
}
109
112
113
+ bson_free (dir_path_plus_star );
110
114
_findclose (handle );
111
115
112
116
return paths_index ;
You can’t perform that action at this time.
0 commit comments