[ruby/optparse] Escape backslashes

https://github.com/ruby/optparse/commit/b14c2c644d
This commit is contained in:
Nobuyoshi Nakada 2024-02-09 12:17:31 +09:00 committed by git
parent 0923a98868
commit 50bcaa6286

View File

@ -1033,7 +1033,7 @@ XXX
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