Don't print empty dialog caption.
authorNick Clifton <nickc@redhat.com>
Tue, 9 Apr 2002 17:15:00 +0000 (17:15 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 9 Apr 2002 17:15:00 +0000 (17:15 +0000)
Add testcase.

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

index f7e942dacedd4682e25c41de74c3cabff07b6350..a1869a99a5d56612c42ff02e51762c76a654a373 100644 (file)
@@ -11,6 +11,7 @@
 
        * resrc.c (write_rc_dialog): Print style even if it is 0.
        (write_rc_directory): Fix overlooked sublang shift bug.
+       (bin_to_res_dialog): Don't print empty dialog caption.
 
        * resbin.c (bin_to_res_dialog): Use signature to identify
        DIALOGEX.
index bd116a2cfdb745341b3471112774da357451258c..0684aec2ee301787cdf214a7177bd47470fad5ab 100644 (file)
@@ -517,6 +517,8 @@ bin_to_res_dialog (data, length, big_endian)
 
   d->caption = get_unicode (data + off, length - off, big_endian, &sublen);
   off += sublen * 2 + 2;
+  if (sublen == 0) 
+    d->caption = NULL;
 
   if ((d->style & DS_SETFONT) == 0)
     {
index 63b1a5c1b036d4c77ed1db97d75cb5a9a659cb68..d4eae76026204558774387dde03fc78d3a3bc586 100644 (file)
        in strings.
        * binutils-all/windres/escapex.rsd: Expected output
 
+       * binutils-all/windres/nocaption.rc: New test case dialogs without
+       captions.
+       * binutils-all/windres/nocaption.rsd: Expected output
+
        * binutils-all/windres/quoteclass.rc: New test case for quoted
        CLASS definitions in DIALOG resources.
 
diff --git a/binutils/testsuite/binutils-all/windres/nocaption.rc b/binutils/testsuite/binutils-all/windres/nocaption.rc
new file mode 100644 (file)
index 0000000..1f3c20f
--- /dev/null
@@ -0,0 +1,4 @@
+101 DIALOG DISCARDABLE  0, 0, 186, 95
+BEGIN
+    DEFPUSHBUTTON "OK",1,129,7,50,14
+END
diff --git a/binutils/testsuite/binutils-all/windres/nocaption.rsd b/binutils/testsuite/binutils-all/windres/nocaption.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.......