]>
Commit | Line | Data |
---|---|---|
1f2f436a A |
1 | --- readpassphrase.c.orig 2009-11-07 14:51:38.000000000 -0800 |
2 | +++ readpassphrase.c 2009-11-07 14:51:39.000000000 -0800 | |
3 | @@ -33,6 +33,8 @@ static const char rcsid[] = "$OpenBSD: r | |
3d9156a7 A |
4 | #include <sys/cdefs.h> |
5 | __FBSDID("$FreeBSD: src/lib/libc/gen/readpassphrase.c,v 1.6 2002/03/09 03:16:41 green Exp $"); | |
6 | ||
7 | +#include "xlocale_private.h" | |
8 | + | |
9 | #include "namespace.h" | |
10 | #include <ctype.h> | |
11 | #include <errno.h> | |
1f2f436a | 12 | @@ -59,6 +61,7 @@ readpassphrase(const char *prompt, char |
3d9156a7 A |
13 | struct termios term, oterm; |
14 | struct sigaction sa, saveint, savehup, savequit, saveterm; | |
15 | struct sigaction savetstp, savettin, savettou; | |
16 | + locale_t loc = __current_locale(); | |
17 | ||
18 | /* I suppose we could alloc on demand in this case (XXX). */ | |
19 | if (bufsiz == 0) { | |
1f2f436a | 20 | @@ -115,11 +118,11 @@ restart: |
3d9156a7 A |
21 | if (p < end) { |
22 | if ((flags & RPP_SEVENBIT)) | |
23 | ch &= 0x7f; | |
24 | - if (isalpha(ch)) { | |
25 | + if (isalpha_l(ch, loc)) { | |
26 | if ((flags & RPP_FORCELOWER)) | |
27 | - ch = tolower(ch); | |
28 | + ch = tolower_l(ch, loc); | |
29 | if ((flags & RPP_FORCEUPPER)) | |
30 | - ch = toupper(ch); | |
31 | + ch = toupper_l(ch, loc); | |
32 | } | |
33 | *p++ = ch; | |
34 | } |