2008-09-14 23:56:14 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif /* HAVE_CONFIG_H */
|
|
|
|
|
|
|
|
#include "Evil.h"
|
|
|
|
|
|
|
|
|
2010-02-27 23:57:03 -08:00
|
|
|
#ifndef __MINGW32CE__
|
2008-09-14 23:56:14 -07:00
|
|
|
|
|
|
|
static char *
|
|
|
|
replace(char *prev, char *value)
|
|
|
|
{
|
2010-08-21 06:52:25 -07:00
|
|
|
if (!value)
|
2008-09-14 23:56:14 -07:00
|
|
|
return prev;
|
|
|
|
|
|
|
|
if (prev)
|
|
|
|
free (prev);
|
|
|
|
return strdup (value);
|
|
|
|
}
|
|
|
|
|
|
|
|
char *
|
|
|
|
nl_langinfo(nl_item index)
|
|
|
|
{
|
|
|
|
static char *result = NULL;
|
|
|
|
static char *nothing = "";
|
|
|
|
|
|
|
|
switch (index)
|
|
|
|
{
|
|
|
|
case CODESET:
|
|
|
|
{
|
|
|
|
char *p;
|
|
|
|
result = replace(result, setlocale(LC_CTYPE, NULL));
|
2010-08-21 06:52:25 -07:00
|
|
|
if (!(p = strrchr(result, '.')))
|
2008-09-14 23:56:14 -07:00
|
|
|
return nothing;
|
|
|
|
|
|
|
|
if ((++p - result) > 2)
|
|
|
|
strcpy(result, "cp");
|
|
|
|
else
|
|
|
|
*result = '\0';
|
|
|
|
strcat(result, p);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
2009-06-10 10:33:18 -07:00
|
|
|
case RADIXCHAR:
|
|
|
|
{
|
2012-04-25 21:40:45 -07:00
|
|
|
return localeconv()->decimal_point;
|
2009-06-10 10:33:18 -07:00
|
|
|
}
|
2008-09-14 23:56:14 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return nothing;
|
|
|
|
}
|
|
|
|
|
2010-02-27 23:57:03 -08:00
|
|
|
#endif /* ! __MINGW32CE__ */
|