aboutsummaryrefslogtreecommitdiff
path: root/binutils/resrc.c
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2011-10-25 08:03:18 +0000
committerKai Tietz <kai.tietz@onevision.com>2011-10-25 08:03:18 +0000
commit81472056d738c3b07914f3dad5edb0f4af45a050 (patch)
tree3273d71c8c4bf457ccf5ba1bcbfda3792f41a151 /binutils/resrc.c
parent977888b9906f450cc0f3f2ecf917e7b33aaf1217 (diff)
downloadgdb-81472056d738c3b07914f3dad5edb0f4af45a050.zip
gdb-81472056d738c3b07914f3dad5edb0f4af45a050.tar.gz
gdb-81472056d738c3b07914f3dad5edb0f4af45a050.tar.bz2
2011-10-25 Kai Tietz <ktietz@redhat.com>
* winduni.h (unicode_from_ascii_len): New prototype. * winduni.c (unicode_from_ascii_len): New function. * windres.h (define_stringtable): Add additional length argument. * windres.c (define_stringtable): Add length argument for string. * rcparse.y (res_unicode_sizedstring): New rule. (res_unicode_sizedstring_concat): Likewise. (string_data): Adjust rule. 2011-10-25 Kai Tietz <ktietz@redhat.com> * binutils-all/windres/strtab4.rc: New test. * binutils-all/windres/strtab4.rsd: Likewise.
Diffstat (limited to 'binutils/resrc.c')
-rw-r--r--binutils/resrc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/binutils/resrc.c b/binutils/resrc.c
index a0308df..62bc9fe 100644
--- a/binutils/resrc.c
+++ b/binutils/resrc.c
@@ -1591,8 +1591,9 @@ define_rcdata_number (rc_uint_type val, int dword)
void
define_stringtable (const rc_res_res_info *resinfo,
- rc_uint_type stringid, const unichar *string)
+ rc_uint_type stringid, const unichar *string, int len)
{
+ unichar *h;
rc_res_id id;
rc_res_resource *r;
@@ -1616,9 +1617,12 @@ define_stringtable (const rc_res_res_info *resinfo,
r->res_info = *resinfo;
}
-
- r->u.stringtable->strings[stringid & 0xf].length = unichar_len (string);
- r->u.stringtable->strings[stringid & 0xf].string = unichar_dup (string);
+ h = (unichar *) res_alloc ((len + 1) * sizeof (unichar));
+ if (len)
+ memcpy (h, string, len * sizeof (unichar));
+ h[len] = 0;
+ r->u.stringtable->strings[stringid & 0xf].length = (rc_uint_type) len;
+ r->u.stringtable->strings[stringid & 0xf].string = h;
}
void