Ticket #850: lc_all.patch

File lc_all.patch, 924 bytes (added by pini, 9 years ago)
  • navit/main.c

    Description: Set lang instead of LC_ALL to prevent decimal separator bugs
     In case LC_ALL is set, unset it and set LANG instead.
    Author: Gilles Filippini <pini@debian.org>
    Forwarded: http://trac.navit-project.org/ticket/850
    Last-Update: 2011-05-08
    old new  
    407407        main_setup_environment(2);
    408408#endif  /* _WIN32 || _WIN32_WCE */
    409409
    410         if (getenv("LC_ALL"))
     410        if (getenv("LC_ALL")) {
    411411                dbg(0,"Warning: LC_ALL is set, this might lead to problems (e.g. strange positions from GPS)\n");
     412                dbg(0,"Warning: Unsetting LC_ALL and setting LANG instead as a workaround.\n");
     413                setenv("LANG", getenv("LC_ALL"), 1);
     414                unsetenv("LC_ALL");
     415        }
    412416        s = getenv("NAVIT_WID");
    413417        if (s) {
    414418                setenv("SDL_WINDOWID", s, 0);