diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index 75828758..db539958 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -1191,7 +1191,7 @@ static void setconfig(char *root) static void setcaption(void) { pc_printf("SourcePawn Compiler " SVN_FULL_VERSION "\n"); - pc_printf("Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2007 AlliedModders, LLC\n\n"); + pc_printf("Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC\n\n"); } static void about(void) @@ -2777,15 +2777,21 @@ static cell initarray(int ident,int tag,int dim[],int numdim,int cur, constvalue *enumroot,int *errorfound) { cell dsize,totalsize; - int idx,abortparse; + int idx,abortparse,needbrace; assert(cur>=0 && cur=0); assert(cur+2<=numdim);/* there must be 2 dimensions or more to do */ assert(errorfound!=NULL && *errorfound==FALSE); totalsize=0; + needbrace=1; needtoken('{'); for (idx=0,abortparse=FALSE; !abortparse; idx++) { + if (matchtoken('}')) + { + needbrace=0; + break; + } /* In case the major dimension is zero, we need to store the offset * to the newly detected sub-array into the indirection table; i.e. * this table needs to be expanded and updated. @@ -2815,7 +2821,10 @@ static cell initarray(int ident,int tag,int dim[],int numdim,int cur, if (*errorfound || !matchtoken(',')) abortparse=TRUE; } /* for */ - needtoken('}'); + if (needbrace) + { + needtoken('}'); + } assert(counteddim!=NULL); if (counteddim[cur]>0) { if (idx(int)size) { /* e.g. "myvar[3]={1,2,3,4};" */ - error(18); /* initialisation data exceeds declared size */ + error(18); /* initialization data exceeds declared size */ litidx=(int)size+curlit; /* avoid overflow in memory moves */ } /* if */ return size;