From 2fbbc0324eef82b7965c5542c9ace66c771f1aaf Mon Sep 17 00:00:00 2001 From: marcobaye Date: Mon, 18 May 2020 23:47:15 +0000 Subject: [PATCH] added comments for next change git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@173 4df02467-bbd4-4a76-a152-e7ce94205b78 --- src/alu.c | 2 ++ src/input.c | 9 ++++++--- src/pseudoopcodes.c | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/alu.c b/src/alu.c index ec7cf07..485c53c 100644 --- a/src/alu.c +++ b/src/alu.c @@ -379,6 +379,8 @@ static void parse_quoted_character(char closing_quote) { intval_t value; + // FIXME - this will fail with backslash escaping! + // read character to parse - make sure not at end of statement if (GetQuotedByte() == CHAR_EOS) return; diff --git a/src/input.c b/src/input.c index 1209762..74867be 100644 --- a/src/input.c +++ b/src/input.c @@ -256,7 +256,7 @@ char GetByte(void) // necessary, because in RAM the source already has // high-level format // Otherwise, the source is a file. This means we will call - // GetFormatted() which will do a shit load of conversions. + // get_processed_from_file() which will do a shit load of conversions. switch (Input_now->source) { case INPUTSRC_RAM: GotByte = *(Input_now->src.ram_ptr++); @@ -379,7 +379,8 @@ char *Input_skip_or_store_block(boolean store) // if wanted, store if (store) DYNABUF_APPEND(GlobalDynaBuf, GotByte); - } while ((GotByte != CHAR_EOS) && (GotByte != byte)); + // it's not enough to check the previous char for backslash, because it might be an escaped backslash... + } while ((GotByte != CHAR_EOS) && (GotByte != byte)); // FIXME - this would fail with backslash escaping! break; case CHAR_SOB: ++depth; @@ -418,7 +419,7 @@ void Input_until_terminator(char terminator) // Okay, read quoted stuff. GetQuotedByte(); // throws error on EOS DYNABUF_APPEND(GlobalDynaBuf, GotByte); - } while ((GotByte != CHAR_EOS) && (GotByte != byte)); + } while ((GotByte != CHAR_EOS) && (GotByte != byte)); // FIXME - this would fail with backslash escaping! // on error, exit now, before calling GetByte() if (GotByte != byte) return; @@ -550,6 +551,7 @@ int Input_read_filename(boolean allow_library, boolean *uses_lib) return TRUE; } + // FIXME - this will fail with backslash escaping! // read characters until closing quote (or EOS) is reached // append platform-converted characters to current string while ((GotByte != CHAR_EOS) && (GotByte != end_quote)) { @@ -579,6 +581,7 @@ int Input_accept_comma(void) } // read optional info about parameter length +// FIXME - move to different file! int Input_get_force_bit(void) { char byte; diff --git a/src/pseudoopcodes.c b/src/pseudoopcodes.c index cb0dbdf..57588e4 100644 --- a/src/pseudoopcodes.c +++ b/src/pseudoopcodes.c @@ -374,6 +374,7 @@ static enum eos encode_string(const struct encoder *inner_encoder, char xor) if (GotByte == '"') { // read initial character GetQuotedByte(); + // FIXME - this will fail with backslash escaping! // send characters until closing quote is reached while (GotByte && (GotByte != '"')) { output_8(xor ^ encoding_encode_char(GotByte)); @@ -1201,6 +1202,7 @@ static enum eos throw_string(const char prefix[], void (*fn)(const char *)) if (GotByte == '"') { // parse string GetQuotedByte(); // read initial character + // FIXME - this will fail with backslash escaping! // send characters until closing quote is reached while (GotByte && (GotByte != '"')) { DYNABUF_APPEND(user_message, GotByte);