Skip to content

Commit

Permalink
MatchPattern: add suggested changes
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Ferbar <[email protected]>
  • Loading branch information
ferbar committed Jul 17, 2020
1 parent d0e6ea0 commit 4effc45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/fluent/match.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ def match(str)

class GlobMatchPattern < MatchPattern
def initialize(pat)
if pat[0,1] == "/"
if pat[pat.length - 1,1] == "/"
@regex = Regexp.new("\\A"+pat[1, pat.length-2]+"\\Z")
if pat.start_with?('/')
if pat.end_with?('/')
@regex = Regexp.new("\\A"+pat[1..-2]+"\\Z")
return
else
raise Fluent::ConfigError, "invalid match - regex"
Expand Down

0 comments on commit 4effc45

Please sign in to comment.