Author: cazfi
Date: Thu Nov  3 19:25:00 2016
New Revision: 34360

URL: http://svn.gna.org/viewcvs/freeciv?rev=34360&view=rev
Log:
Made sdl2-client theme loading to respect DIR_SEPARATOR

See patch #7903

Modified:
    trunk/client/gui-sdl2/themes.c
    trunk/client/gui-sdl2/themespec.c

Modified: trunk/client/gui-sdl2/themes.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl2/themes.c?rev=34360&r1=34359&r2=34360&view=diff
==============================================================================
--- trunk/client/gui-sdl2/themes.c      (original)
+++ trunk/client/gui-sdl2/themes.c      Thu Nov  3 19:25:00 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: trunk/client/gui-sdl2/themespec.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl2/themespec.c?rev=34360&r1=34359&r2=34360&view=diff
==============================================================================
--- trunk/client/gui-sdl2/themespec.c   (original)
+++ trunk/client/gui-sdl2/themespec.c   Thu Nov  3 19:25:00 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

Reply via email to