Removed trailing whitespace from all *.?pp files
[supertux.git] / src / lisp / parser.cpp
index e6a4198..53f6469 100644 (file)
 namespace lisp {
 
 Parser::Parser(bool translate) :
-  lexer(0), 
+  lexer(0),
   filename(),
-  dictionary_manager(0), 
+  dictionary_manager(0),
   dictionary(0),
   token(),
+  searchpath(),
   obst()
 {
   if(translate) {
     dictionary_manager = new tinygettext::DictionaryManager();
     dictionary_manager->set_charset("UTF-8");
-    if (g_config && (g_config->locale != "")) 
+    if (g_config && (g_config->locale != ""))
       dictionary_manager->set_language(tinygettext::Language::from_name(g_config->locale));
   }
 
   obstack_init(&obst);
+  searchpath = PHYSFS_getSearchPath();
 }
 
 Parser::~Parser()
@@ -53,6 +55,7 @@ Parser::~Parser()
   obstack_free(&obst, NULL);
   delete lexer;
   delete dictionary_manager;
+  PHYSFS_freeList(searchpath);
 }
 
 static std::string dirname(const std::string& filename)
@@ -78,7 +81,6 @@ Parser::parse(const std::string& filename)
 
   if(dictionary_manager) {
     std::string rel_dir = dirname (filename);
-    char **searchpath = PHYSFS_getSearchPath();
     for(char** i = searchpath; *i != NULL; i++)
     {
       std::string abs_dir = std::string (*i) + PHYSFS_getDirSeparator () + rel_dir;