diff options
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/usr.bin/man/man/man.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/gnu/usr.bin/man/man/man.c b/gnu/usr.bin/man/man/man.c index 92e9f840ff42..0ecae7f224de 100644 --- a/gnu/usr.bin/man/man/man.c +++ b/gnu/usr.bin/man/man/man.c @@ -479,18 +479,22 @@ man_getopt (argc, argv) || tmp != short_locale + 2 || strlen(tmp + 1) < 4 || tmp[3] != '.') { - errno = EINVAL; - perror ("bad ctype locale env"); - exit (1); - } - tmp[1] = short_locale[0]; - tmp[2] = short_locale[1]; - short_locale = tmp + 1; - tmp = short_locale + 3; - for (pltable = ltable; pltable->lcode != NULL; pltable++) { - if (strcmp(pltable->lcode, tmp) == 0) { - locale_nroff = pltable->nroff; - break; + if (debug) { + errno = EINVAL; + perror ("ctype locale env"); + } + free(short_locale); + locale = NULL; + } else { + tmp[1] = short_locale[0]; + tmp[2] = short_locale[1]; + short_locale = tmp + 1; + tmp = short_locale + 3; + for (pltable = ltable; pltable->lcode != NULL; pltable++) { + if (strcmp(pltable->lcode, tmp) == 0) { + locale_nroff = pltable->nroff; + break; + } } } } |
