diff options
Diffstat (limited to 'man3/duplocale.3')
-rw-r--r-- | man3/duplocale.3 | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/man3/duplocale.3 b/man3/duplocale.3 index c8872a091..2e3126863 100644 --- a/man3/duplocale.3 +++ b/man3/duplocale.3 @@ -122,39 +122,39 @@ ABC #include <locale.h> #include <stdio.h> #include <stdlib.h> - +\& #define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \e } while (0) - +\& int main(int argc, char *argv[]) { locale_t loc, nloc; - +\& if (argc != 2) { fprintf(stderr, "Usage: %s string\en", argv[0]); exit(EXIT_FAILURE); } - +\& /* This sequence is necessary, because uselocale() might return the value LC_GLOBAL_LOCALE, which can\[aq]t be passed as an argument to toupper_l(). */ - +\& loc = uselocale((locale_t) 0); if (loc == (locale_t) 0) errExit("uselocale"); - +\& nloc = duplocale(loc); if (nloc == (locale_t) 0) errExit("duplocale"); - +\& for (char *p = argv[1]; *p; p++) putchar(toupper_l(*p, nloc)); - +\& printf("\en"); - +\& freelocale(nloc); - +\& exit(EXIT_SUCCESS); } .EE |