BUFR: The 'count' key works differently from GRIB
@@ -800,6 +800,7 @@ grib_handle* gts_new_from_file( grib_context* c, FILE* f,int *error )
gl->product_kind = PRODUCT_GTS;
grib_context_increment_handle_file_count(c);
grib_context_increment_handle_total_count(c);
+ if (gl->offset == 0) grib_context_set_handle_file_count(c,1);
return gl;
}
@@ -838,6 +839,7 @@ grib_handle* taf_new_from_file( grib_context* c, FILE* f,int *error )
gl->product_kind = PRODUCT_TAF;
grib_context_increment_handle_file_count(c);
grib_context_increment_handle_total_count(c);
+ if (gl->offset == 0) grib_context_set_handle_file_count(c,1);
return gl;
}
@@ -876,6 +878,7 @@ grib_handle* metar_new_from_file( grib_context* c, FILE* f,int *error )
gl->product_kind = PRODUCT_METAR;
grib_context_increment_handle_file_count(c);
grib_context_increment_handle_total_count(c);
+ if (gl->offset == 0) grib_context_set_handle_file_count(c,1);
return gl;
}
@@ -914,6 +917,7 @@ grib_handle* bufr_new_from_file( grib_context* c, FILE* f,int *error )
gl->product_kind = PRODUCT_BUFR;
grib_context_increment_handle_file_count(c);
grib_context_increment_handle_total_count(c);
+ if (gl->offset == 0) grib_context_set_handle_file_count(c,1);
return gl;
}
@@ -952,6 +956,7 @@ grib_handle* any_new_from_file( grib_context* c, FILE* f,int *error )
gl->product_kind = PRODUCT_ANY;
grib_context_increment_handle_file_count(c);
grib_context_increment_handle_total_count(c);
+ if (gl->offset == 0) grib_context_set_handle_file_count(c,1);
return gl;
}
