fixed some bugs, added LIST, Makefile & .distr

This commit is contained in:
eck 1989-12-18 15:49:11 +00:00
parent d43142d811
commit 8a409311da
5 changed files with 26 additions and 5 deletions

View file

@ -0,0 +1,4 @@
LIST
Makefile
localeconv.c
setlocale.c

View file

@ -0,0 +1,2 @@
localeconv.c
setlocale.c

View file

@ -0,0 +1,12 @@
CFLAGS=-L -LIB
.SUFFIXES: .o .e .c
.e.o:
$(CC) $(CFLAGS) -c -o $@ $*.e
clean:
rm -rf localeconv.o setlocale.o OLIST
localeconv.o:
setlocale.o:

View file

@ -23,6 +23,7 @@ localeconv(void)
lcp->mon_grouping = "";
lcp->positive_sign = "";
lcp->negative_sign = "";
lcp->int_frac_digits = CHAR_MAX;
lcp->frac_digits = CHAR_MAX;
lcp->p_cs_precedes = CHAR_MAX;
lcp->p_sep_by_space = CHAR_MAX;

View file

@ -4,22 +4,24 @@
/* $Header$ */
#include <locale.h>
#include <string.h>
struct lconv _lc;
char *
setlocale(int category, const char *locale)
{
if (strcmp(locale, "C")) return (char *)NULL;
if (!locale) return "C";
if (*locale && strcmp(locale, "C")) return (char *)NULL;
switch(category) {
case LC_ALL:
case LC_COLLATE:
case LC_CTYPE:
case LC_MONETARY:
case LC_NUMERIC:
case LC_COLLATE:
case LC_TIME:
return locale;
case LC_NUMERIC:
case LC_MONETARY:
return *locale ? (char *)locale : "C";
default:
return (char *)NULL;
}