Fix:Core:Strip /bin from win32 module name
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 28 Jun 2011 09:10:52 +0000 (09:10 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 28 Jun 2011 09:10:52 +0000 (09:10 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4546 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/main.c

index 73d68a4..94ae4b3 100644 (file)
@@ -380,6 +380,7 @@ main_init(const char *program)
        {
                char  filename[MAX_PATH + 1],
                     *end;
+               int len;
 
                *filename = '\0';
 #ifdef _UNICODE                /* currently for wince */
@@ -394,6 +395,10 @@ main_init(const char *program)
                        if(end)
                                *end = '\0';
                }
+               len=strlen(filename);
+               if (len > 4 && !strcmp(filename+len-4,"\\bin")) {
+                       filename[len-4]='\0';
+               }
                setenv("NAVIT_PREFIX", filename, 0);
        }
        if (!getenv("HOME"))