From 8526739066ccb00ccd24b74650a7d7b284442985 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 21 Jun 2018 13:10:40 -0700 Subject: MM-10934 Update server dependencies. (#8981) * Changing throttled import path. * Upgrading dependencies. --- vendor/github.com/go-ini/ini/parser.go | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'vendor/github.com/go-ini/ini/parser.go') diff --git a/vendor/github.com/go-ini/ini/parser.go b/vendor/github.com/go-ini/ini/parser.go index 826e893c0..d5aa2db60 100644 --- a/vendor/github.com/go-ini/ini/parser.go +++ b/vendor/github.com/go-ini/ini/parser.go @@ -198,7 +198,7 @@ func hasSurroundedQuote(in string, quote byte) bool { func (p *parser) readValue(in []byte, parserBufferSize int, - ignoreContinuation, ignoreInlineComment, unescapeValueDoubleQuotes, unescapeValueCommentSymbols, allowPythonMultilines bool) (string, error) { + ignoreContinuation, ignoreInlineComment, unescapeValueDoubleQuotes, unescapeValueCommentSymbols, allowPythonMultilines, spaceBeforeInlineComment bool) (string, error) { line := strings.TrimLeftFunc(string(in), unicode.IsSpace) if len(line) == 0 { @@ -240,11 +240,22 @@ func (p *parser) readValue(in []byte, // Check if ignore inline comment if !ignoreInlineComment { - i := strings.IndexAny(line, "#;") + var i int + if spaceBeforeInlineComment { + i = strings.Index(line, " #") + if i == -1 { + i = strings.Index(line, " ;") + } + + } else { + i = strings.IndexAny(line, "#;") + } + if i > -1 { p.comment.WriteString(line[i:]) line = strings.TrimSpace(line[:i]) } + } // Trim single and double quotes @@ -429,7 +440,8 @@ func (f *File) parse(reader io.Reader) (err error) { f.options.IgnoreInlineComment, f.options.UnescapeValueDoubleQuotes, f.options.UnescapeValueCommentSymbols, - f.options.AllowPythonMultilineValues) + f.options.AllowPythonMultilineValues, + f.options.SpaceBeforeInlineComment) if err != nil { return err } @@ -458,7 +470,8 @@ func (f *File) parse(reader io.Reader) (err error) { f.options.IgnoreInlineComment, f.options.UnescapeValueDoubleQuotes, f.options.UnescapeValueCommentSymbols, - f.options.AllowPythonMultilineValues) + f.options.AllowPythonMultilineValues, + f.options.SpaceBeforeInlineComment) if err != nil { return err } -- cgit v1.2.3-1-g7c22