From b24eb5ac22f573f4f45547872cdadcf7f7c9d682 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 9 Apr 2002 17:06:14 +0000 Subject: [PATCH] Fix overlooked sublang shift bug. Add testcase. --- binutils/ChangeLog | 14 ++++++++------ binutils/resrc.c | 3 ++- binutils/testsuite/ChangeLog | 4 ++++ binutils/testsuite/binutils-all/windres/sublang.rc | 5 +++++ .../testsuite/binutils-all/windres/sublang.rsd | 8 ++++++++ 5 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 binutils/testsuite/binutils-all/windres/sublang.rc create mode 100644 binutils/testsuite/binutils-all/windres/sublang.rsd diff --git a/binutils/ChangeLog b/binutils/ChangeLog index ecbd2ac71fd..f7e942daced 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -5,15 +5,17 @@ Fix typo in BEDIT warning. Don't add default dialog style when explicit style specified. - * rclex.l: "\xhex" encoding in strings corrected. - "\a" escape (used for right justified key definitions in menus) is - encodes as binary 8. + * rclex.l (handle_quotes): "\xhex" encoding in strings corrected. + (handle_quotes) "\a" escape (used for right justified key + definitions in menus) is encodes as binary 8. - * resrc.c: Print style even if it is 0. + * resrc.c (write_rc_dialog): Print style even if it is 0. + (write_rc_directory): Fix overlooked sublang shift bug. - * resbin.c: Use signature to identify DIALOGEX. + * resbin.c (bin_to_res_dialog): Use signature to identify + DIALOGEX. - * windres.c: Set default LANGUAGE to english/us. + * windres.c (main): Set default LANGUAGE to english/us. 2002-04-09 Gunnar Degnbol diff --git a/binutils/resrc.c b/binutils/resrc.c index a9b3ba8f0b4..773e08ab716 100644 --- a/binutils/resrc.c +++ b/binutils/resrc.c @@ -1592,7 +1592,8 @@ write_rc_directory (e, rd, type, name, language, level) && (re->id.u.id & 0xffff) == re->id.u.id) { fprintf (e, "LANGUAGE %lu, %lu\n", - re->id.u.id & 0xff, (re->id.u.id >> 8) & 0xff); + re->id.u.id & ((1 << SUBLANG_SHIFT) - 1), + (re->id.u.id >> SUBLANG_SHIFT) & 0xff); *language = re->id.u.id; } break; diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index 033935ab61f..63b1a5c1b03 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -19,6 +19,10 @@ * binutils-all/windres/quoteclass.rc: New test case for quoted CLASS definitions in DIALOG resources. + * binutils-all/windres/sublang.rc: New test case: Check assignment + of sub-language. + * binutils-all/windres/sublang.rsd: Expected output. + 2002-02-18 Timothy Daly * binutils-all/readelf.r: Change expected output to match new, diff --git a/binutils/testsuite/binutils-all/windres/sublang.rc b/binutils/testsuite/binutils-all/windres/sublang.rc new file mode 100644 index 00000000000..a37921b33d2 --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/sublang.rc @@ -0,0 +1,5 @@ +LANGUAGE 9, 1 +101 DIALOG DISCARDABLE 0, 0, 186, 95 +BEGIN + DEFPUSHBUTTON "OK",1,129,7,50,14 +END diff --git a/binutils/testsuite/binutils-all/windres/sublang.rsd b/binutils/testsuite/binutils-all/windres/sublang.rsd new file mode 100644 index 00000000000..36b68c24a5f --- /dev/null +++ b/binutils/testsuite/binutils-all/windres/sublang.rsd @@ -0,0 +1,8 @@ + 0000 00000000 20000000 ffff0000 ffff0000 .... ........... + 0010 00000000 00000000 00000000 00000000 ................ + 0020 36000000 20000000 ffff0500 ffff6500 6... .........e. + 0030 00000000 10100904 00000000 00000000 ................ + 0040 00008880 00000000 01000000 0000ba00 ................ + 0050 5f000000 00000000 01000150 00000000 _..........P.... + 0060 81000700 32000e00 0100ffff 80004f00 ....2.........O. + 0070 4b000000 00000000 K....... -- 2.30.2