Fix:Core:Fixed config file handling
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 26 May 2008 18:27:21 +0000 (18:27 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Mon, 26 May 2008 18:27:21 +0000 (18:27 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit@1081 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/main.c

index 4ca2d89..cc9e8af 100644 (file)
@@ -239,15 +239,15 @@ int main(int argc, char **argv)
        }
        li = list;
        do {
-        // Try the next config file possibility from the list
-               config_file = li->data;
-               if (!file_exists(config_file)) g_free(config_file);
-               li = g_list_next(li);
                if (li == NULL) {
                        // We have not found an existing config file from all possibilities
                        printf(_("No config file navit.xml, navit.xml.local found\n"));
                        exit(1);
                }
+        // Try the next config file possibility from the list
+               config_file = li->data;
+               if (!file_exists(config_file)) g_free(config_file);
+               li = g_list_next(li);
        } while (!file_exists(config_file));
        g_list_free(list);