From bfb6c1ab1ed502faa7c3764722a1f1661f6d44e8 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 11 Oct 2011 15:56:29 +0000 Subject: PR binutils/13051 Fix a syntax error bug when compiling rc files with the VERSIONINFO resource containing more than one language block inside a single StringFileInfo block. * windint.h (rc_ver_stringtable): New structure definition. (rc_ver_info): Use it. * rcparse.y (verstringtable): New variable. (verstringtables): New type. (verstringtables:): New rule declaration. (verblocks:): Use it. * resrc.c (append_ver_stringtable): New function. (append_ver_stringfileinfo): Update to use stringtables. * windres.h (append_ver_stringfileinfo): Update declaration. (append_ver_stringtable): New declaration. * resrc.c (write_rc_versioninfo): Update to support multiple blocks. * resbin.c (bin_to_res_version): Likewise. (res_to_bin_versioninfo): Likewise. * binutils-all\windres\version.rsd: Regenerate. * binutils-all\windres\version_cat.rsd: Regenerate. * binutils-all\windres\version_mlang.rc: Add new test. * binutils-all\windres\version_mlang.rsd: Likewise. --- binutils/rcparse.y | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'binutils/rcparse.y') diff --git a/binutils/rcparse.y b/binutils/rcparse.y index 8caa3ef..e260792 100644 --- a/binutils/rcparse.y +++ b/binutils/rcparse.y @@ -1,6 +1,6 @@ %{ /* rcparse.y -- parser for Windows rc files - Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008 - Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007, 2008, + 2011 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. Extended by Kai Tietz, Onevision. @@ -79,6 +79,7 @@ static const rc_res_id res_null_text = { 1, {{0, &null_unichar}}}; rc_rcdata_item *rcdata_item; rc_fixed_versioninfo *fixver; rc_ver_info *verinfo; + rc_ver_stringtable *verstringtable; rc_ver_stringinfo *verstring; rc_ver_varinfo *vervar; rc_toolbar_item *toobar_item; @@ -150,6 +151,7 @@ static const rc_res_id res_null_text = { 1, {{0, &null_unichar}}}; %type opt_control_data %type fixedverinfo %type verblocks +%type verstringtables %type vervals %type vertrans %type toolbar_data @@ -1471,9 +1473,9 @@ verblocks: { $$ = NULL; } - | verblocks BLOCKSTRINGFILEINFO BEG BLOCK BEG vervals END END + | verblocks BLOCKSTRINGFILEINFO BEG verstringtables END { - $$ = append_ver_stringfileinfo ($1, $4, $6); + $$ = append_ver_stringfileinfo ($1, $4); } | verblocks BLOCKVARFILEINFO BEG VALUE res_unicode_string_concat vertrans END { @@ -1481,6 +1483,17 @@ verblocks: } ; +verstringtables: + /* empty */ + { + $$ = NULL; + } + | verstringtables BLOCK BEG vervals END + { + $$ = append_ver_stringtable ($1, $2, $4); + } + ; + vervals: /* empty */ { -- cgit v1.1