Index: trunk/src_plugins/import_gerb/geparse.c =================================================================== --- trunk/src_plugins/import_gerb/geparse.c (revision 781) +++ trunk/src_plugins/import_gerb/geparse.c (revision 782) @@ -289,7 +289,7 @@ } \ } while(0) -#define READ_APERTURE(_ctx_, _aid_) \ +#define READ_APERTURE(_ctx_, _aid_, _allow_empty_) \ do { \ int __c__; \ READ(_ctx_, __c__); \ @@ -300,8 +300,14 @@ } \ READ_NUM(_ctx_, _aid_); \ } \ - else \ - _aid_ = 10; \ + else { \ + if (!_allow_empty_) { \ + _ctx_->errmsg = "Expected 'D' for aperture ID - empty aperture not supported in this context"; \ + return GEP_ERROR; \ + } \ + else \ + _aid_ = -42; \ + } \ } while(0) /* Append a macro name into a gds string, utnil endchr or '*' (endchr is not consumed) */ @@ -662,7 +668,11 @@ int c1, c2, c; long aid; - READ_APERTURE(ctx, aid); + READ_APERTURE(ctx, aid, 1); + if (aid == -42) { + READ_LONGEND(ctx); + return GEP_NEXT; + } if (aid < 10) { ctx->errmsg = "invalid aperture ID: must be at least 10"; return GEP_ERROR;