Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release-src > by-pkgid > 6fd0cb2f6a9f8309b62c0078400b08ba > files > 7

corsixth-0.2-3mdv2010.1.src.rpm

Index: CorsixTH/Lua/app.lua
===================================================================
--- CorsixTH/Lua/app.lua	(revision 604)
+++ CorsixTH/Lua/app.lua	(working copy)
@@ -593,6 +593,15 @@
   return data
 end
 
+function App:checkFileExists(file_path)
+  local fh = io.open(file_path, "rb")
+  if fh == nil then
+    return false
+  end
+  io.close(fh)
+  return true
+end
+
 function App:getDataFilename(dir, filename)
   if filename == nil then
     filename = dir
@@ -600,7 +609,14 @@
   end
   dir = dir:upper()
   dir = self.data_dir_map[dir] or dir
-  return self.config.theme_hospital_install .. dir .. pathsep .. filename:upper()
+
+  local filename_to_use = filename:upper()
+
+  if self:checkFileExists(self.config.theme_hospital_install .. dir .. pathsep .. filename_to_use) == false then
+    filename_to_use = filename:lower()
+  end
+
+  return self.config.theme_hospital_install .. dir .. pathsep .. filename_to_use
 end
 
 function App:readDataFile(dir, filename)