Skip to content

Commit fbfe4a1

Browse files
committed
Fixed crash when doing %macro('"')
1 parent 9ae0a91 commit fbfe4a1

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/asar/libstr.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,15 +540,23 @@ inline char * strqrchr(const char * str, char key)
540540
const char * ret= nullptr;
541541
while (*str)
542542
{
543-
if (*str=='"')
543+
if (*str=='"' || *str=='\'')
544544
{
545+
char token = *str;
546+
545547
str++;
546-
while (*str!='"')
548+
549+
// Special case hack for '''
550+
if (str[0] == '\'' && str[1] == '\'') { str += 2; }
551+
else
547552
{
548-
if (!*str) return nullptr;
553+
while (*str != token)
554+
{
555+
if (!*str) return nullptr;
556+
str++;
557+
}
549558
str++;
550559
}
551-
str++;
552560
}
553561
else
554562
{

0 commit comments

Comments
 (0)