]> git.saurik.com Git - apple/libc.git/blob - gen/FreeBSD/readpassphrase.c.patch
Libc-594.1.4.tar.gz
[apple/libc.git] / gen / FreeBSD / readpassphrase.c.patch
1 --- readpassphrase.c.orig 2003-05-20 15:21:02.000000000 -0700
2 +++ readpassphrase.c 2005-02-24 17:00:36.000000000 -0800
3 @@ -33,6 +33,8 @@
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>
12 @@ -59,6 +61,7 @@
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) {
20 @@ -115,11 +118,11 @@
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 }