summaryrefslogtreecommitdiff
path: root/riscos
diff options
context:
space:
mode:
Diffstat (limited to 'riscos')
-rw-r--r--riscos/dialog.c14
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);