mirror of
https://github.com/uffejakobsen/acme.git
synced 2024-11-25 23:49:25 +00:00
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
This commit is contained in:
parent
5b37c4d24e
commit
85f0c32ff4
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user