Skip to content

Commit e1eef85

Browse files
alexeyvohanumantmk
authored andcommitted
Fix error while compile using vs10 on windows:
mongoc-database.c(687): error C2275: 'bson_string_t' : illegal use of this type as an expression Closes #117
1 parent 83817ce commit e1eef85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mongoc/mongoc-database.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ _mongoc_database_find_collections_legacy (mongoc_database_t *database,
707707

708708
/* Filtering on name needs to be handled differently for old servers. */
709709
if (filter && bson_iter_init_find (&iter, filter, "name")) {
710+
bson_string_t *buf;
710711
/* on legacy servers, this must be a string (i.e. not a regex) */
711712
if (!BSON_ITER_HOLDS_UTF8 (&iter)) {
712713
bson_set_error (error,
@@ -720,7 +721,7 @@ _mongoc_database_find_collections_legacy (mongoc_database_t *database,
720721
bson_init (&legacy_filter);
721722
bson_copy_to_excluding_noinit (filter, &legacy_filter, "name", NULL);
722723
/* We must db-qualify filters on name. */
723-
bson_string_t *buf = bson_string_new (database->name);
724+
buf = bson_string_new (database->name);
724725
bson_string_append_c (buf, '.');
725726
bson_string_append (buf, col_filter);
726727
BSON_APPEND_UTF8 (&legacy_filter, "name", buf->str);

0 commit comments

Comments
 (0)