File src/filehandling_functions.c changed (mode: 100644) (index f018ac6..b813f77) |
3 |
3 |
* |
* |
4 |
4 |
* Copyright (C) 1999 Przemek Borys <pborys@dione.ids.pl> |
* Copyright (C) 1999 Przemek Borys <pborys@dione.ids.pl> |
5 |
5 |
* Copyright (C) 2005 Bas Zoetekouw <bas@debian.org> |
* Copyright (C) 2005 Bas Zoetekouw <bas@debian.org> |
|
6 |
|
* Copyright (C) 2005 Nathanael Nerode <neroden@gcc.gnu.org> |
6 |
7 |
* |
* |
7 |
8 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
8 |
9 |
* it under the terms of version 2 of the GNU General Public License as |
* it under the terms of version 2 of the GNU General Public License as |
|
... |
... |
initpaths() |
850 |
851 |
char **paths = NULL; |
char **paths = NULL; |
851 |
852 |
char *infopath = NULL, *langpath = NULL; |
char *infopath = NULL, *langpath = NULL; |
852 |
853 |
char *c, *dir, *env; |
char *c, *dir, *env; |
853 |
|
char *lang, *langshort = NULL; |
|
|
854 |
|
char *rawlang, *lang, *langshort = NULL; |
854 |
855 |
int ret; |
int ret; |
855 |
856 |
unsigned int i, j, maxpaths, numpaths = 0, infolen, langlen; |
unsigned int i, j, maxpaths, numpaths = 0, infolen, langlen; |
856 |
857 |
size_t len; |
size_t len; |
|
... |
... |
initpaths() |
885 |
886 |
} |
} |
886 |
887 |
|
|
887 |
888 |
/* get the current $LANG, if any (to use for localized info pages) */ |
/* get the current $LANG, if any (to use for localized info pages) */ |
888 |
|
lang = strdup(getenv("LANG")); |
|
889 |
|
/* fix the lang string */ |
|
890 |
|
for (i=0; lang[i]!='\0'; i++) |
|
891 |
|
{ |
|
892 |
|
/* cut off the charset */ |
|
893 |
|
if (lang[i]=='.') |
|
894 |
|
{ |
|
895 |
|
lang[i]='\0'; |
|
896 |
|
} |
|
897 |
|
/* if lang is sublocalized (nl_BE or so), also use short version */ |
|
898 |
|
if (lang[i]=='_' && langshort==NULL) |
|
|
889 |
|
rawlang = getenv("LANG"); |
|
890 |
|
if (rawlang) { |
|
891 |
|
lang = strdup(rawlang); |
|
892 |
|
/* fix the lang string */ |
|
893 |
|
for (i=0; lang[i]!='\0'; i++) |
899 |
894 |
{ |
{ |
900 |
|
langshort = strdup(lang); |
|
901 |
|
langshort[i] = '\0'; |
|
|
895 |
|
/* cut off the charset */ |
|
896 |
|
if (lang[i]=='.') |
|
897 |
|
{ |
|
898 |
|
lang[i]='\0'; |
|
899 |
|
} |
|
900 |
|
/* if lang is sublocalized (nl_BE or so), also use short version */ |
|
901 |
|
if (lang[i]=='_' && langshort==NULL) |
|
902 |
|
{ |
|
903 |
|
langshort = strdup(lang); |
|
904 |
|
langshort[i] = '\0'; |
|
905 |
|
} |
902 |
906 |
} |
} |
903 |
907 |
} |
} |
904 |
908 |
/* if we have a LANG defined, add paths with this lang to the paths[] */ |
/* if we have a LANG defined, add paths with this lang to the paths[] */ |