From 85f0c32ff4226eebe4a3e0db7b6d44af2e846275 Mon Sep 17 00:00:00 2001 From: marcobaye Date: Sun, 21 Jun 2020 15:16:38 +0000 Subject: [PATCH] fixed convert-to-lower-case function so keywords may contain underscore in future git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@246 4df02467-bbd4-4a76-a152-e7ce94205b78 --- src/dynabuf.c | 11 ++++++++--- src/version.h | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/dynabuf.c b/src/dynabuf.c index 46b4d39..2c48804 100644 --- a/src/dynabuf.c +++ b/src/dynabuf.c @@ -109,7 +109,8 @@ static char *ensure_free_space(struct dynabuf *db, int size) void DynaBuf_to_lower(struct dynabuf *target, struct dynabuf *source) { char *read, - *write; + *write, + byte; // make sure target can take it if (source->size > target->reserved) @@ -117,8 +118,12 @@ void DynaBuf_to_lower(struct dynabuf *target, struct dynabuf *source) // convert to lower case read = source->buffer; // CAUTION - ptr may change when buf grows! write = target->buffer; // CAUTION - ptr may change when buf grows! - while (*read) - *write++ = (*read++) | 32; + while ((byte = *read++)) { + // we want to keep underscore, so this check restricts: + if (byte <= 'Z') + byte |= 32; + *write++ = byte; + } // Okay, so this method of converting to lowercase is lousy. // But actually it doesn't matter, because only pre-defined // keywords are converted, and all of those are plain diff --git a/src/version.h b/src/version.h index 25c2079..54a0ac4 100644 --- a/src/version.h +++ b/src/version.h @@ -9,7 +9,7 @@ #define RELEASE "0.96.5" // update before release FIXME #define CODENAME "Fenchurch" // update before release -#define CHANGE_DATE "20 June" // update before release FIXME +#define CHANGE_DATE "21 June" // update before release FIXME #define CHANGE_YEAR "2020" // update before release //#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/" #define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME