[project @ 2006-03-25 22:48:32 by jmb]

Assert that template names are <=11 chars long.
Rename con_language to con_lang

svn path=/import/netsurf/; revision=2165
This commit is contained in:
John Mark Bell 2006-03-25 22:48:32 +00:00
parent 5a72700817
commit c098703201
11 changed files with 8 additions and 19 deletions

Binary file not shown.

View File

@ -701,7 +701,7 @@ con_theme:Themes
con_cache:Cache
con_home:Home page
con_inter:Interface
con_language:Language
con_lang:Language
con_security:Security

Binary file not shown.

View File

@ -700,7 +700,7 @@ con_theme:Themes
con_cache:Cache
con_home:Home page
con_inter:Interface
con_language:Language
con_lang:Language
con_security:Security

Binary file not shown.

View File

@ -701,7 +701,7 @@ con_theme:Themes
con_cache:Cache
con_home:Home page
con_inter:Interface
con_language:Language
con_lang:Language
con_security:Security

Binary file not shown.

View File

@ -703,7 +703,7 @@ con_theme:Themes
con_cache:Cache
con_home:Home page
con_inter:Interface
con_language:Language
con_lang:Language
con_security:Security

Binary file not shown.

View File

@ -80,7 +80,7 @@ void ro_gui_configure_initialise(void) {
ro_gui_configure_register("con_home",
ro_gui_options_home_initialise,
ro_gui_wimp_event_finalise);
ro_gui_configure_register("con_language",
ro_gui_configure_register("con_lang",
ro_gui_options_language_initialise,
ro_gui_wimp_event_finalise);
ro_gui_configure_register("con_inter",

View File

@ -249,17 +249,12 @@ wimp_window * ro_gui_dialog_load_template(const char *template_name)
wimp_window *window;
os_error *error;
/* Template names must be <= 11 chars long */
assert(strlen(template_name) <= 11);
/* 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);
@ -283,12 +278,6 @@ 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);