mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-01 00:34:31 +03:00
[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:
parent
5a72700817
commit
c098703201
Binary file not shown.
@ -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.
@ -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.
@ -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.
@ -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.
@ -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",
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user