Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
5c02057f
Commit
5c02057f
authored
Oct 19, 2006
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed infinite loops after includes and at eof
parent
12a5e5ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
src/util/io/reader.cpp
src/util/io/reader.cpp
+6
-1
src/util/io/reader.hpp
src/util/io/reader.hpp
+1
-0
No files found.
src/util/io/reader.cpp
View file @
5c02057f
...
@@ -91,6 +91,11 @@ void Reader::readLine() {
...
@@ -91,6 +91,11 @@ void Reader::readLine() {
key
.
clear
();
key
.
clear
();
return
;
return
;
}
}
if
(
key
.
empty
()
&&
input
->
Eof
())
{
// end of file
indent
=
-
1
;
return
;
}
key
=
cannocial_name_form
(
trim
(
line
.
substr
(
indent
,
pos
-
indent
)));
key
=
cannocial_name_form
(
trim
(
line
.
substr
(
indent
,
pos
-
indent
)));
value
=
pos
==
String
::
npos
?
_
(
""
)
:
trim_left
(
line
.
substr
(
pos
+
1
));
value
=
pos
==
String
::
npos
?
_
(
""
)
:
trim_left
(
line
.
substr
(
pos
+
1
));
}
}
...
@@ -112,7 +117,7 @@ template <> void Reader::handle(String& s) {
...
@@ -112,7 +117,7 @@ template <> void Reader::handle(String& s) {
bool
first
=
true
;
bool
first
=
true
;
// read all lines that are indented enough
// read all lines that are indented enough
readLine
();
readLine
();
while
(
indent
>=
expected_indent
)
{
while
(
indent
>=
expected_indent
&&
!
input
->
Eof
()
)
{
if
(
!
first
)
multi_line_str
+=
_
(
'\n'
);
if
(
!
first
)
multi_line_str
+=
_
(
'\n'
);
first
=
false
;
first
=
false
;
multi_line_str
+=
line
.
substr
(
expected_indent
);
// strip expected indent
multi_line_str
+=
line
.
substr
(
expected_indent
);
// strip expected indent
...
...
src/util/io/reader.hpp
View file @
5c02057f
...
@@ -114,6 +114,7 @@ class Reader {
...
@@ -114,6 +114,7 @@ class Reader {
if
(
key
==
_
(
"include_file"
))
{
if
(
key
==
_
(
"include_file"
))
{
Reader
reader
(
value
);
Reader
reader
(
value
);
reader
.
handle
(
v
);
reader
.
handle
(
v
);
moveNext
();
}
else
{
}
else
{
unknownKey
();
unknownKey
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment