From eb022aca1e2e3c2aa6fe4143574d0e59c8b47073 Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 17 Jan 1995 22:55:59 +0000 Subject: Make conv=[lu]case works with localized ctype (8bit) --- bin/dd/dd.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/dd/dd.c b/bin/dd/dd.c index dbef8c1..dc55aed 100644 --- a/bin/dd/dd.c +++ b/bin/dd/dd.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: dd.c,v 1.2 1994/09/24 02:54:52 davidg Exp $ */ #ifndef lint @@ -195,8 +195,18 @@ setup() if (islower(cnt)) ctab[cnt] = ctab[toupper(cnt)]; } - else + else { ctab = ddflags & C_LCASE ? u2l : l2u; + if (ddflags & C_LCASE) { + for (cnt = 0; cnt < 0377; ++cnt) + if (isupper(cnt)) + ctab[cnt] = tolower(cnt); + } else { + for (cnt = 0; cnt < 0377; ++cnt) + if (islower(cnt)) + ctab[cnt] = toupper(cnt); + } + } (void)time(&st.start); /* Statistics timestamp. */ } -- cgit v1.1