diff options
author | ache <ache@FreeBSD.org> | 1996-10-31 08:01:16 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1996-10-31 08:01:16 +0000 |
commit | e39dc02ecd01f07b2e9a0fddfb05478518c754c7 (patch) | |
tree | 415d7295c4042267a730c72d417bfe114701123a /gnu/usr.bin | |
parent | ae538a3fbdd7a152b632f6cad205c4cda9c24787 (diff) | |
download | FreeBSD-src-e39dc02ecd01f07b2e9a0fddfb05478518c754c7.zip FreeBSD-src-e39dc02ecd01f07b2e9a0fddfb05478518c754c7.tar.gz |
Localize it
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/man/man/glob.c | 23 | ||||
-rw-r--r-- | gnu/usr.bin/man/man/man.c | 6 |
2 files changed, 29 insertions, 0 deletions
diff --git a/gnu/usr.bin/man/man/glob.c b/gnu/usr.bin/man/man/glob.c index ba4be06..65eb1fa 100644 --- a/gnu/usr.bin/man/man/glob.c +++ b/gnu/usr.bin/man/man/glob.c @@ -110,6 +110,23 @@ extern char *alloca (); int noglob_dot_filenames = 1; static int glob_match_after_star (); + +#ifdef __FreeBSD__ +static int collate_range_cmp (a, b) + int a, b; +{ + int r; + static char s[2][2]; + + if ((unsigned char)a == (unsigned char)b) + return 0; + s[0][0] = a; + s[1][0] = b; + if ((r = strcoll(s[0], s[1])) == 0) + r = (unsigned char)a - (unsigned char)b; + return r; +} +#endif /* Return nonzero if PATTERN has any special globbing chars in it. */ @@ -239,7 +256,13 @@ glob_match (pattern, text, dot_special) return 0; c = *p++; } +#ifdef __FreeBSD__ + if ( collate_range_cmp (c1, cstart) >= 0 + && collate_range_cmp (c1, cend) <= 0 + ) +#else if (c1 >= cstart && c1 <= cend) +#endif goto match; if (c == ']') break; diff --git a/gnu/usr.bin/man/man/man.c b/gnu/usr.bin/man/man/man.c index d543bf2..e36530b 100644 --- a/gnu/usr.bin/man/man/man.c +++ b/gnu/usr.bin/man/man/man.c @@ -20,6 +20,9 @@ #include <stdio.h> #include <ctype.h> #include <errno.h> +#ifdef __FreeBSD__ +#include <locale.h> +#endif #include <string.h> #include <sys/file.h> #include <signal.h> @@ -133,6 +136,9 @@ main (argc, argv) prognam = mkprogname (argv[0]); unsetenv("IFS"); +#ifdef __FreeBSD__ + (void) setlocale(LC_ALL, ""); +#endif man_getopt (argc, argv); if (optind == argc) |