Author: cazfi Date: Thu Nov 3 19:25:11 2016 New Revision: 34361 URL: http://svn.gna.org/viewcvs/freeciv?rev=34361&view=rev Log: Made sdl/2-client theme loading to respect DIR_SEPARATOR
See patch #7903 Modified: branches/S2_6/client/gui-sdl/themes.c branches/S2_6/client/gui-sdl/themespec.c branches/S2_6/client/gui-sdl2/themes.c branches/S2_6/client/gui-sdl2/themespec.c Modified: branches/S2_6/client/gui-sdl/themes.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl/themes.c?rev=34361&r1=34360&r2=34361&view=diff ============================================================================== --- branches/S2_6/client/gui-sdl/themes.c (original) +++ branches/S2_6/client/gui-sdl/themes.c Thu Nov 3 19:25:11 2016 @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2005 The Freeciv Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,13 +34,15 @@ *****************************************************************************/ void gui_load_theme(const char *directory, const char *theme_name) { - char buf[strlen(directory) + strlen("/") + strlen(theme_name) + strlen("/theme") + 1]; + char buf[strlen(directory) + strlen(DIR_SEPARATOR) + strlen(theme_name) + + strlen(DIR_SEPARATOR "theme") + 1]; /* free previous loaded theme, if any */ theme_free(theme); theme = NULL; - fc_snprintf(buf, sizeof(buf), "%s/%s/theme", directory, theme_name); + fc_snprintf(buf, sizeof(buf), "%s" DIR_SEPARATOR "%s" DIR_SEPARATOR "theme", + directory, theme_name); themespec_try_read(buf); theme_load_sprites(theme); Modified: branches/S2_6/client/gui-sdl/themespec.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl/themespec.c?rev=34361&r1=34360&r2=34361&view=diff ============================================================================== --- branches/S2_6/client/gui-sdl/themespec.c (original) +++ branches/S2_6/client/gui-sdl/themespec.c Thu Nov 3 19:25:11 2016 @@ -232,9 +232,8 @@ char fname[strlen(theme_name) + strlen(THEMESPEC_SUFFIX) + 1], *dname; fc_snprintf(fname, sizeof(fname), - "%s%s", theme_name, THEMESPEC_SUFFIX); - -/* dname = fileinfoname(get_data_dirs(), fname);*/ + "%s%s", theme_name, THEMESPEC_SUFFIX); + dname = fname; if (dname) { Modified: branches/S2_6/client/gui-sdl2/themes.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl2/themes.c?rev=34361&r1=34360&r2=34361&view=diff ============================================================================== --- branches/S2_6/client/gui-sdl2/themes.c (original) +++ branches/S2_6/client/gui-sdl2/themes.c Thu Nov 3 19:25:11 2016 @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2005 The Freeciv Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,13 +34,15 @@ *****************************************************************************/ void gui_load_theme(const char *directory, const char *theme_name) { - char buf[strlen(directory) + strlen("/") + strlen(theme_name) + strlen("/theme") + 1]; + char buf[strlen(directory) + strlen(DIR_SEPARATOR) + strlen(theme_name) + + strlen(DIR_SEPARATOR "theme") + 1]; /* free previous loaded theme, if any */ theme_free(theme); theme = NULL; - fc_snprintf(buf, sizeof(buf), "%s/%s/theme", directory, theme_name); + fc_snprintf(buf, sizeof(buf), "%s" DIR_SEPARATOR "%s" DIR_SEPARATOR "theme", + directory, theme_name); themespec_try_read(buf); theme_load_sprites(theme); Modified: branches/S2_6/client/gui-sdl2/themespec.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl2/themespec.c?rev=34361&r1=34360&r2=34361&view=diff ============================================================================== --- branches/S2_6/client/gui-sdl2/themespec.c (original) +++ branches/S2_6/client/gui-sdl2/themespec.c Thu Nov 3 19:25:11 2016 @@ -235,9 +235,8 @@ char fname[strlen(theme_name) + strlen(THEMESPEC_SUFFIX) + 1], *dname; fc_snprintf(fname, sizeof(fname), - "%s%s", theme_name, THEMESPEC_SUFFIX); - -/* dname = fileinfoname(get_data_dirs(), fname);*/ + "%s%s", theme_name, THEMESPEC_SUFFIX); + dname = fname; if (dname) { _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits