From 49e423b057f804edfce3a03c23454c31b05abd0c Mon Sep 17 00:00:00 2001 From: Cooper Harasyn Date: Mon, 13 Mar 2023 11:39:00 -0700 Subject: [PATCH 1/2] Print an invalid character as hex This prevents an error where the first byte of UTF-8 sequences gets printed out as-is, and causes a UTF-8 decoding error during CoilSnake compilation --- src/lexer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lexer.cpp b/src/lexer.cpp index 3fe889f..8d23721 100644 --- a/src/lexer.cpp +++ b/src/lexer.cpp @@ -349,7 +349,9 @@ symbol Lexer::LexSymbol() return LexNumber(); } else { - Error(string("unexpected character '") + current + "'"); + char buf[8]; + snprintf(buf, 8, "%02X", (unsigned int)(current & 0xFF)); + Error(string("unexpected character 0x") + buf); Next(); continue; } From 3ab67a782139ab426b7156e6d4856b4d827b52bf Mon Sep 17 00:00:00 2001 From: Cooper Harasyn Date: Mon, 13 Mar 2023 13:24:34 -0700 Subject: [PATCH 2/2] Bump version number to 1.401 (1.400 had been used previously for the insertbin functionality) --- README.md | 10 +++++----- setup.py | 2 +- src/ccc.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 143684a..8977eec 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -CCScript 1.337 (LEGACY) +CCScript 1.401 ======================= This is the older, crappier version of CCScript, last updated Auguest 24, 2009. -This version is no longer maintained; this repository exists mainly for easy -reference in the development of CCScript 2, but also to track some minor tweaks -to CCScript 1.3's build system and code so that it can actually be compiled on -non-Windows platforms. +This version is not frequently maintained; this repository exists mainly for +easy reference in the development of CCScript 2, but also to track some minor +tweaks to CCScript 1's build system and code so that it can actually be +compiled on non-Windows platforms. diff --git a/setup.py b/setup.py index 3a65f2b..96faa6c 100755 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ extra_compile_args = ["-std=c++11"] setup(name="ccscript", - version="1.339", + version="1.401", description="ccscript", url="http://starmen.net/pkhack/ccscript", ext_modules=[ diff --git a/src/ccc.cpp b/src/ccc.cpp index 431baa0..b8b3a6c 100644 --- a/src/ccc.cpp +++ b/src/ccc.cpp @@ -42,7 +42,7 @@ string getbasepath(const char* p) void printversion() { - cout << "ccc version 1.339 Duck Tape Edition" << endl; + cout << "ccc version 1.401 Duck Tape Edition" << endl; } void printusage()