Skip to content

Commit

Permalink
- fix segmentation fault on windows when OPENMODELICAHOME is not set.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16611 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Matthias Arzt committed Jul 17, 2013
1 parent 98c9cf3 commit 6f17cfd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Compiler/runtime/systemimpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,11 @@ void SystemImpl__gettextInit(const char *locale)
}
free(old_ctype);
#endif /* __MINGW32__ */
if(omhome == NULL)
{
fprintf(stderr, "Warning: environment variable OPENMODELICAHOME is not set. Cannot load locale.\n");
return;
}
omlen = strlen(omhome);
localedir = (char*) malloc(omlen + 25);
sprintf(localedir, "%s/share/locale", omhome);
Expand Down

0 comments on commit 6f17cfd

Please sign in to comment.