projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1facc42
)
Read the first 5 chars, not the all string of LANG.
author
Ricardo Cruz
<rick2@aeiou.pt>
Fri, 16 Jul 2004 19:15:00 +0000
(19:15 +0000)
committer
Ricardo Cruz
<rick2@aeiou.pt>
Fri, 16 Jul 2004 19:15:00 +0000
(19:15 +0000)
SVN-Revision: 1580
src/lispreader.cpp
patch
|
blob
|
history
diff --git
a/src/lispreader.cpp
b/src/lispreader.cpp
index
58913e5
..
99e7925
100644
(file)
--- a/
src/lispreader.cpp
+++ b/
src/lispreader.cpp
@@
-1221,9
+1221,18
@@
LispReader::read_string (const char* name, std::string& str, bool translatable)
char* lang = getenv("LANG");
char str_[1024]; // check, for instance, for (title-fr_FR "Bonjour")
- sprintf(str_, "%s-%s", name, lang);
- obj = search_for (str_);
+ if(lang != NULL && strlen(lang) >= 5)
+ {
+ char lang_[6];
+ strncpy(lang_, lang, 5);
+ lang_[5] = '\0';
+ sprintf(str_, "%s-%s", name, lang_);
+
+ obj = search_for (str_);
+ }
+ else
+ obj = 0;
if(!obj) // check, for instance, for (title-fr "Bonjour")
{