Skip to content

Commit ab92b22

Browse files
EmilyV99connorjclark
authored andcommitted
fix: ZScript metadata fields cutting off at semicolons in strings
1 parent 41a07b4 commit ab92b22

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

src/zq/ffasm.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3177,19 +3177,8 @@ int32_t parse_script_file(script_data **script, FILE* fscript, bool report_succe
31773177
char temp;
31783178
while ((temp = getc(fscript)) != '\n')
31793179
{
3180-
if (temp == '\r')
3181-
{
3182-
do
3183-
{
3184-
if (feof(fscript))
3185-
{
3186-
stop = true;
3187-
break;
3188-
}
3189-
} while (getc(fscript) != '\n');
3190-
break;
3191-
}
3192-
else buffer += temp;
3180+
if (temp != '\r')
3181+
buffer += temp;
31933182
if (feof(fscript))
31943183
{
31953184
stop = true;

src/zscrdata.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,7 @@ bool zasm_meta::parse_meta(const char *buffer)
505505
string cmd = line.substr(0, space_pos); //The command portion
506506
size_t end_space_pos = line.find_first_not_of(" \t=", space_pos);
507507
if(end_space_pos == string::npos) return false;
508-
size_t semi = line.find_first_of(";",end_space_pos);
509-
string val = line.substr(end_space_pos, (semi == string::npos ? semi : semi-end_space_pos-1)); //The value portion
508+
string val = line.substr(end_space_pos); //The value portion
510509
size_t endpos = val.find_last_not_of(" \t\r\n\0");
511510
if(endpos != string::npos) ++endpos;
512511
val = val.substr(0, endpos); //trim trailing whitespace

0 commit comments

Comments
 (0)