From 3e4ce3b2e6f5a68a505cdef1445d84b801cb20ef Mon Sep 17 00:00:00 2001 From: yufukui Date: Tue, 3 Apr 2018 22:22:50 +0900 Subject: [PATCH 1/2] fix escaping of exclude arg --- bin/piculet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/piculet b/bin/piculet index a7cef01..243509c 100755 --- a/bin/piculet +++ b/bin/piculet @@ -95,7 +95,7 @@ ARGV.options do |opt| # Remap groups to exclude to regular expressions (if they're surrounded by '/') if options[:exclude_sgs] options[:exclude_sgs].map! do |name| - name =~ /\A\/(.*)\/\z/ ? Regexp.new($1) : Regexp.new("\A#{Regexp.escape(name)}\z") + name =~ /\A\/(.*)\/\z/ ? Regexp.new($1) : Regexp.new("\\A#{Regexp.escape(name)}\\z") end end From 668864820b2f714c697ae9ef0d858950c362682a Mon Sep 17 00:00:00 2001 From: yufukui Date: Tue, 3 Apr 2018 22:52:27 +0900 Subject: [PATCH 2/2] allow backslashes in sg name --- bin/piculet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/piculet b/bin/piculet index 243509c..70e1552 100755 --- a/bin/piculet +++ b/bin/piculet @@ -95,7 +95,7 @@ ARGV.options do |opt| # Remap groups to exclude to regular expressions (if they're surrounded by '/') if options[:exclude_sgs] options[:exclude_sgs].map! do |name| - name =~ /\A\/(.*)\/\z/ ? Regexp.new($1) : Regexp.new("\\A#{Regexp.escape(name)}\\z") + name =~ /\A\/(.*)\/\z/ ? Regexp.new($1) : Regexp.new('\A' + Regexp.escape(name) + '\z') end end