diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2006-01-25 12:49:51 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2006-01-25 12:49:51 +0000 |
commit | 45b78bc199cac5e5f32be205191242e364c82be3 (patch) | |
tree | ece1c2cead32d23c7593534a09a088386521732d | |
parent | 9f7e57c99d15b4489ed05d145f0ea53e69bccf45 (diff) | |
download | netsurf-45b78bc199cac5e5f32be205191242e364c82be3.tar.gz netsurf-45b78bc199cac5e5f32be205191242e364c82be3.tar.bz2 |
[project @ 2006-01-25 12:49:51 by rjw]
Possible workaround for OS template loading bug.
svn path=/import/netsurf/; revision=2041
-rw-r--r-- | riscos/dialog.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/riscos/dialog.c b/riscos/dialog.c index 7946a1146..0f6dcb043 100644 --- a/riscos/dialog.c +++ b/riscos/dialog.c @@ -246,6 +246,14 @@ wimp_window * ro_gui_dialog_load_template(const char *template_name) /* wimp_load_template won't accept a const char * */ strncpy(name, template_name, sizeof name); + /* there is an OS bug such that wimp_load_template with a 12 character + * name will sometimes fail. to work around it we truncate such names to a + * 10 character wildcarded name, eg 'con_language' -> 'con_langua*' */ + if (strlen(template_name) > 11) { + name[10] = '*'; + name[11] = '\0'; + } + /* find required buffer sizes */ error = xwimp_load_template(wimp_GET_SIZE, 0, 0, wimp_NO_FONTS, name, 0, &window_size, &data_size, &context); @@ -269,6 +277,12 @@ wimp_window * ro_gui_dialog_load_template(const char *template_name) die("NoMemory"); } + /* the OS has updated our name, so we reset it back if required*/ + if (strlen(template_name) > 11) { + name[10] = '*'; + name[11] = '\0'; + } + /* load template */ error = xwimp_load_template(window, data, data + data_size, wimp_NO_FONTS, name, 0, 0, 0, 0); |