diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 2001-02-10 06:49:53 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 2001-02-10 06:49:53 +0000 |
commit | dc7d8c99d0440aa23796a70e74b6458e7ce91ae5 (patch) | |
tree | 5102dce7f47474a441c3ebd460a278ad7cfc9cbd /usr.bin | |
parent | fd3f646bbb1e00967a7e2e1af56e28591b1446e7 (diff) | |
download | src-dc7d8c99d0440aa23796a70e74b6458e7ce91ae5.tar.gz src-dc7d8c99d0440aa23796a70e74b6458e7ce91ae5.zip |
Localize it (LC_NUMERIC)
Notes
Notes:
svn path=/head/; revision=72304
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/printf/printf.1 | 3 | ||||
-rw-r--r-- | usr.bin/printf/printf.c | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/usr.bin/printf/printf.1 b/usr.bin/printf/printf.1 index 5e6c94019886..2d510c3bbfc2 100644 --- a/usr.bin/printf/printf.1 +++ b/usr.bin/printf/printf.1 @@ -250,6 +250,9 @@ precision is 0 or missing, all characters in the string are printed. Print a `%'; no argument is used. .El .Pp +The decimal point +character is defined in the program's locale (category LC_NUMERIC). +.Pp In no case does a non-existent or small field width cause truncation of a field; padding takes place only if the specified field width exceeds the actual width. diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index 4b01b4ab48d1..897a063fd9ce 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -67,6 +67,10 @@ static const char rcsid[] = #define warnx3(a, b, c) warnx(a, b, c) #endif +#ifndef BUILTIN +#include <locale.h> +#endif + #define PF(f, func) { \ char *b = NULL; \ if (fieldwidth) \ @@ -109,6 +113,9 @@ main(argc, argv) int ch, end, fieldwidth, precision; char convch, nextch, *format, *fmt, *start; +#ifndef BUILTIN + (void) setlocale(LC_NUMERIC, ""); +#endif while ((ch = getopt(argc, argv, "")) != -1) switch (ch) { case '?': |