Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
ea9c5822
Unverified
Commit
ea9c5822
authored
Sep 30, 2018
by
astaxie
Committed by
GitHub
Sep 30, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3292 from SongLiangChen/master
Read over 4096 length values
parents
ad0d166d
8f455ef1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
6 deletions
+28
-6
ini.go
config/ini.go
+28
-6
No files found.
config/ini.go
View file @
ea9c5822
...
...
@@ -78,15 +78,37 @@ func (ini *IniConfig) parseData(dir string, data []byte) (*IniConfigContainer, e
}
}
section
:=
defaultSection
tmpBuf
:=
bytes
.
NewBuffer
(
nil
)
for
{
line
,
_
,
err
:=
buf
.
ReadLine
()
if
err
==
io
.
EOF
{
break
tmpBuf
.
Reset
()
shouldBreak
:=
false
for
{
tmp
,
isPrefix
,
err
:=
buf
.
ReadLine
()
if
err
==
io
.
EOF
{
shouldBreak
=
true
break
}
//It might be a good idea to throw a error on all unknonw errors?
if
_
,
ok
:=
err
.
(
*
os
.
PathError
);
ok
{
return
nil
,
err
}
tmpBuf
.
Write
(
tmp
)
if
isPrefix
{
continue
}
if
!
isPrefix
{
break
}
}
//It might be a good idea to throw a error on all unknonw errors?
if
_
,
ok
:=
err
.
(
*
os
.
PathError
);
ok
{
return
nil
,
err
if
shouldBreak
{
break
}
line
:=
tmpBuf
.
Bytes
()
line
=
bytes
.
TrimSpace
(
line
)
if
bytes
.
Equal
(
line
,
bEmpty
)
{
continue
...
...
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