From 428a496ca391e55e30bc52c5912250cf0f028af1 Mon Sep 17 00:00:00 2001 From: zacheiss Date: Sun, 15 Feb 2004 01:54:32 +0000 Subject: [PATCH] Don't upcase the next character if we're looking at a character with the high bit set. --- include/moira.h | 2 +- lib/fixname.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/moira.h b/include/moira.h index 593877cc..658b67f5 100644 --- a/include/moira.h +++ b/include/moira.h @@ -90,7 +90,7 @@ char *canonicalize_hostname(char *s); /* prototypes from fixname.c */ void FixName(char *ilnm, char *ifnm, char *last, char *first, char *middle); -void FixCase(char *p); +void FixCase(unsigned char *p); void LookForJrAndIII(char *nm, int *pends_jr, int *pends_sr, int *pends_ii, int *pends_iii, int *pends_iv, int *pends_v); diff --git a/lib/fixname.c b/lib/fixname.c index dc37c0e5..d77bf37a 100644 --- a/lib/fixname.c +++ b/lib/fixname.c @@ -48,7 +48,7 @@ void FixName(char *ilnm, char *ifnm, char *last, char *first, char *middle) strncpy(first, ifnm, FIRST_LEN); } -void FixCase(char *p) +void FixCase(unsigned char *p) { int up; /* Should next letter be uppercase */ int pos; /* Position within word */ @@ -69,6 +69,8 @@ void FixCase(char *p) } else if (*p == '\'') /* If ', next letter should be upper only */ up = (pos == 2); /* if the ' is the 2nd char in the name */ + else if (*p >= 0x80) /* If the high bit is set, don't touch it. */ + up = 0; else up = 1; /* If other punctuation (eg, -), upper */ } -- 2.45.2