Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alu Folie
SRB2
Commits
474f94ef
Commit
474f94ef
authored
1 year ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Fix escaping of '{'
parent
2f56d1ee
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/usdf.c
+12
-5
12 additions, 5 deletions
src/usdf.c
with
12 additions
and
5 deletions
src/usdf.c
+
12
−
5
View file @
474f94ef
...
@@ -268,6 +268,10 @@ static char *EscapeStringChars(const char *string, int tokenizer_line)
...
@@ -268,6 +268,10 @@ static char *EscapeStringChars(const char *string, int tokenizer_line)
case
'\''
:
case
'\''
:
BUFWRITE
(
'\''
);
BUFWRITE
(
'\''
);
break
;
break
;
case
'{'
:
BUFWRITE
(
'\\'
);
BUFWRITE
(
'{'
);
break
;
case
'x'
:
{
case
'x'
:
{
int
out
=
0
,
c
;
int
out
=
0
,
c
;
int
i
=
0
;
int
i
=
0
;
...
@@ -319,6 +323,8 @@ static char *EscapeStringChars(const char *string, int tokenizer_line)
...
@@ -319,6 +323,8 @@ static char *EscapeStringChars(const char *string, int tokenizer_line)
BUFWRITE
((
char
)
out
);
BUFWRITE
((
char
)
out
);
}
}
else
ParseError
(
tokenizer_line
,
CONS_WARNING
,
"In string: unknown escape sequence '
\\
%c'"
,
chr
);
break
;
break
;
}
}
}
}
...
@@ -659,16 +665,15 @@ static char *ParseText(char *text, size_t *text_length, boolean parse_scripts, i
...
@@ -659,16 +665,15 @@ static char *ParseText(char *text, size_t *text_length, boolean parse_scripts, i
if
(
chr
==
'\\'
)
if
(
chr
==
'\\'
)
{
{
if
(
input
[
1
]
==
'{'
)
unsigned
char
nextchar
=
input
[
1
];
if
(
nextchar
==
'{'
)
{
{
WRITE_TEXTCHAR
(
input
[
1
]
);
WRITE_TEXTCHAR
(
nextchar
);
input
+=
2
;
input
++
;
}
}
else
else
WRITE_TEXTCHAR
(
chr
);
WRITE_TEXTCHAR
(
chr
);
}
}
else
if
(
chr
==
0xFF
)
;
// Just ignore it
else
if
(
chr
==
'{'
)
else
if
(
chr
==
'{'
)
{
{
input
++
;
input
++
;
...
@@ -680,6 +685,8 @@ static char *ParseText(char *text, size_t *text_length, boolean parse_scripts, i
...
@@ -680,6 +685,8 @@ static char *ParseText(char *text, size_t *text_length, boolean parse_scripts, i
GetCommandEnd
(
&
input
);
GetCommandEnd
(
&
input
);
}
}
else
if
(
chr
==
0xFF
)
;
// Just ignore it
else
else
WRITE_TEXTCHAR
(
chr
);
WRITE_TEXTCHAR
(
chr
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment