summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/ini.v1/parser.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2023-01-28 22:57:53 +0100
committerGitHub <noreply@github.com>2023-01-28 22:57:53 +0100
commit880586bac42817ffcfea5d9f746f503fa29915b8 (patch)
treea89374cba6f88975f12316ec8d1b8aa1d4c6ba79 /vendor/gopkg.in/ini.v1/parser.go
parenteac2a8c8dc831f946970d327e2a80b26b0684255 (diff)
downloadmatterbridge-msglm-880586bac42817ffcfea5d9f746f503fa29915b8.tar.gz
matterbridge-msglm-880586bac42817ffcfea5d9f746f503fa29915b8.tar.bz2
matterbridge-msglm-880586bac42817ffcfea5d9f746f503fa29915b8.zip
Update dependencies (#1951)
Diffstat (limited to 'vendor/gopkg.in/ini.v1/parser.go')
-rw-r--r--vendor/gopkg.in/ini.v1/parser.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/gopkg.in/ini.v1/parser.go b/vendor/gopkg.in/ini.v1/parser.go
index ac1c980a..44fc526c 100644
--- a/vendor/gopkg.in/ini.v1/parser.go
+++ b/vendor/gopkg.in/ini.v1/parser.go
@@ -164,6 +164,10 @@ func readKeyName(delimiters string, in []byte) (string, int, error) {
if endIdx < 0 {
return "", -1, ErrDelimiterNotFound{line}
}
+ if endIdx == 0 {
+ return "", -1, ErrEmptyKeyName{line}
+ }
+
return strings.TrimSpace(line[0:endIdx]), endIdx + 1, nil
}
@@ -463,8 +467,9 @@ func (f *File) parse(reader io.Reader) (err error) {
kname, offset, err := readKeyName(f.options.KeyValueDelimiters, line)
if err != nil {
+ switch {
// Treat as boolean key when desired, and whole line is key name.
- if IsErrDelimiterNotFound(err) {
+ case IsErrDelimiterNotFound(err):
switch {
case f.options.AllowBooleanKeys:
kname, err := p.readValue(line, parserBufferSize)
@@ -482,6 +487,8 @@ func (f *File) parse(reader io.Reader) (err error) {
case f.options.SkipUnrecognizableLines:
continue
}
+ case IsErrEmptyKeyName(err) && f.options.SkipUnrecognizableLines:
+ continue
}
return err
}