From d8608af81238608f800b489d5e8754b7b5bb7fca Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Tue, 17 May 2005 23:46:36 +0000 Subject: [project @ 2005-05-17 23:46:36 by rjw] Make long theme names work on old filesystems. svn path=/import/netsurf/; revision=1726 --- riscos/theme.c | 5 +++++ riscos/theme_install.c | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'riscos') diff --git a/riscos/theme.c b/riscos/theme.c index 7b34641be..aab6785d5 100644 --- a/riscos/theme.c +++ b/riscos/theme.c @@ -146,6 +146,11 @@ struct theme_descriptor *ro_gui_theme_find(const char *leafname) { descriptor = descriptor->next) if (!strcmp(leafname, descriptor->leafname)) return descriptor; + /* fallback for 10 chars on old filesystems */ + for (descriptor = theme_descriptors; descriptor; + descriptor = descriptor->next) + if (!strncmp(leafname, descriptor->leafname, 10)) + return descriptor; return NULL; } diff --git a/riscos/theme_install.c b/riscos/theme_install.c index 583e67c30..93ef0a97d 100644 --- a/riscos/theme_install.c +++ b/riscos/theme_install.c @@ -257,11 +257,10 @@ void theme_install_install(bool apply) warn_user("ThemeApplyErr", 0); } else { free(option_theme); - option_theme = theme_file; + option_theme = strdup(theme_install->leafname); } - } else { - free(theme_file); } + free(theme_file); } -- cgit v1.2.3