Fix overlooked sublang shift bug.
authorNick Clifton <nickc@redhat.com>
Tue, 9 Apr 2002 17:06:14 +0000 (17:06 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 9 Apr 2002 17:06:14 +0000 (17:06 +0000)
Add testcase.

binutils/ChangeLog
binutils/resrc.c
binutils/testsuite/ChangeLog
binutils/testsuite/binutils-all/windres/sublang.rc [new file with mode: 0644]
binutils/testsuite/binutils-all/windres/sublang.rsd [new file with mode: 0644]

index ecbd2ac71fdf8cc639d87c229ea0be1587918909..f7e942dacedd4682e25c41de74c3cabff07b6350 100644 (file)
@@ -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 <degnbol@danbbs.dk>
 
index a9b3ba8f0b4250d8124f6d95be17f3418bdf4108..773e08ab716832adb7733c49db26c69378a0c544 100644 (file)
@@ -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;
index 033935ab61f96c4362f6be798ffacb505a1f39a9..63b1a5c1b036d4c77ed1db97d75cb5a9a659cb68 100644 (file)
        * 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  <remote_bob@yahoo.com>
 
        * 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 (file)
index 0000000..a37921b
--- /dev/null
@@ -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 (file)
index 0000000..36b68c2
--- /dev/null
@@ -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.......