Skip to content

Commit

Permalink
* lib/optparse.rb (OptionParser#compsys): escape brackets too.
Browse files Browse the repository at this point in the history
  [ruby-dev:42754]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
znz committed Dec 26, 2010
1 parent 2ea38fd commit 0924e52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Mon Dec 27 07:32:07 2010 Kazuhiro NISHIYAMA <[email protected]>

* lib/optparse.rb (OptionParser#compsys): escape brackets too.
[ruby-dev:42754]

Mon Dec 27 01:30:08 2010 Tanaka Akira <[email protected]>

* ext/socket/mkconstants.rb: add IF_NAMESIZE.
Expand Down
2 changes: 1 addition & 1 deletion lib/optparse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ def compsys(to, name = File.basename($0)) # :nodoc:
to << "#compdef #{name}\n"
to << COMPSYS_HEADER
visit(:compsys, {}, {}) {|o, d|
to << %Q[ "#{o}[#{d.gsub(/\"/, '\"')}]" \\\n]
to << %Q[ "#{o}[#{d.gsub(/[\"\[\]]/, '\\\\\&')}]" \\\n]
}
to << " '*:file:_files' && return 0\n"
end
Expand Down

0 comments on commit 0924e52

Please sign in to comment.