diff --git a/lib/optparse.rb b/lib/optparse.rb index 05415901a3..7d366a7353 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -1237,7 +1237,8 @@ XXX # +indent+:: Indentation, defaults to @summary_indent. # def summarize(to = [], width = @summary_width, max = width - 1, indent = @summary_indent, &blk) - blk ||= proc {|l| to << (l.index($/, -1) ? l : l + $/)} + nl = "\n" + blk ||= proc {|l| to << (l.index(nl, -1) ? l : l + nl)} visit(:summarize, {}, {}, width, max, indent, &blk) to end