Re: [AD] Figuring out the language from the environment variable LANG |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Thu, Jan 23, 2003 at 02:40:44PM +0100, Eric Botcazou wrote:
> Ok for mainline, with the following minor corrections:
I always forget about 'its'. Let's see this variation:
install_allegro automatically calls this function, and if you have an
environment variable named LANG, its first two letters will be used to
set the system language.
> + if ((env_lang = getenv("LANG")) && env_lang[0] && env_lang[1]) {
> + char lang[3] = "en";
>
> Kill the "3".
Any particular reason? Specifying size is safer and -pedantic
allows it. Or I could delete the asignment and later put the NULL
terminator manually, I guess that would generate less assembler
and static memory.
> + /* yes, this is bad, but we only read the first two letters */
>
> "two first letters".
Hehe, letters firts two say would yoda. I trust Ben, his domain
name ends with .uk, and they have Rowan Atkinson.
> + AL_CONST char *ext, *datafile;
> + char filename[1024], *namecpy = ustrdup(name);
>
> Don't mix char[] and char* variables.
Why? It's funny...