X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/7b00c0c43f52e9d27168e67a26aac19065cdb40c..ad3c9f2af814c84582fdd1649e49ec4f68572c5a:/gen/FreeBSD/readpassphrase.c diff --git a/gen/FreeBSD/readpassphrase.c b/gen/FreeBSD/readpassphrase.c index d100be4..45ac15f 100644 --- a/gen/FreeBSD/readpassphrase.c +++ b/gen/FreeBSD/readpassphrase.c @@ -33,6 +33,8 @@ static const char rcsid[] = "$OpenBSD: readpassphrase.c,v 1.12 2001/12/15 05:41: #include __FBSDID("$FreeBSD: src/lib/libc/gen/readpassphrase.c,v 1.6 2002/03/09 03:16:41 green Exp $"); +#include "xlocale_private.h" + #include "namespace.h" #include #include @@ -59,6 +61,7 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) struct termios term, oterm; struct sigaction sa, saveint, savehup, savequit, saveterm; struct sigaction savetstp, savettin, savettou; + locale_t loc = __current_locale(); /* I suppose we could alloc on demand in this case (XXX). */ if (bufsiz == 0) { @@ -115,11 +118,11 @@ restart: if (p < end) { if ((flags & RPP_SEVENBIT)) ch &= 0x7f; - if (isalpha(ch)) { + if (isalpha_l(ch, loc)) { if ((flags & RPP_FORCELOWER)) - ch = tolower(ch); + ch = tolower_l(ch, loc); if ((flags & RPP_FORCEUPPER)) - ch = toupper(ch); + ch = toupper_l(ch, loc); } *p++ = ch; }