From 8a409311da15a67f8745a433bbe4daeec9c4e431 Mon Sep 17 00:00:00 2001 From: eck Date: Mon, 18 Dec 1989 15:49:11 +0000 Subject: [PATCH] fixed some bugs, added LIST, Makefile & .distr --- lang/cem/libcc.ansi/locale/.distr | 4 ++++ lang/cem/libcc.ansi/locale/LIST | 2 ++ lang/cem/libcc.ansi/locale/Makefile | 12 ++++++++++++ lang/cem/libcc.ansi/locale/localeconv.c | 1 + lang/cem/libcc.ansi/locale/setlocale.c | 12 +++++++----- 5 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 lang/cem/libcc.ansi/locale/.distr create mode 100644 lang/cem/libcc.ansi/locale/LIST create mode 100644 lang/cem/libcc.ansi/locale/Makefile diff --git a/lang/cem/libcc.ansi/locale/.distr b/lang/cem/libcc.ansi/locale/.distr new file mode 100644 index 000000000..4e19646b6 --- /dev/null +++ b/lang/cem/libcc.ansi/locale/.distr @@ -0,0 +1,4 @@ +LIST +Makefile +localeconv.c +setlocale.c diff --git a/lang/cem/libcc.ansi/locale/LIST b/lang/cem/libcc.ansi/locale/LIST new file mode 100644 index 000000000..6ec7d31e6 --- /dev/null +++ b/lang/cem/libcc.ansi/locale/LIST @@ -0,0 +1,2 @@ +localeconv.c +setlocale.c diff --git a/lang/cem/libcc.ansi/locale/Makefile b/lang/cem/libcc.ansi/locale/Makefile new file mode 100644 index 000000000..bfc32cb21 --- /dev/null +++ b/lang/cem/libcc.ansi/locale/Makefile @@ -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: diff --git a/lang/cem/libcc.ansi/locale/localeconv.c b/lang/cem/libcc.ansi/locale/localeconv.c index 407a4807c..fdc03a0d6 100644 --- a/lang/cem/libcc.ansi/locale/localeconv.c +++ b/lang/cem/libcc.ansi/locale/localeconv.c @@ -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; diff --git a/lang/cem/libcc.ansi/locale/setlocale.c b/lang/cem/libcc.ansi/locale/setlocale.c index d2b24f352..87bb74a55 100644 --- a/lang/cem/libcc.ansi/locale/setlocale.c +++ b/lang/cem/libcc.ansi/locale/setlocale.c @@ -4,22 +4,24 @@ /* $Header$ */ #include +#include 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; } -- 2.34.1