| 1 | # a patch for compatibility with ruby 2.0 |
| 2 | # |
| 3 | # fixed upstream in version 2013.10.20 07:09 |
| 4 | # http://www.ntg.nl/pipermail/ntg-context/2013/075016.html |
| 5 | # http://tug.org/svn/texlive?view=revision&revision=32605 |
| 6 | # |
| 7 | --- runfiles/texmf-dist/scripts/context/ruby/base/switch.rb.orig |
| 8 | +++ runfiles/texmf-dist/scripts/context/ruby/base/switch.rb |
| 9 | @@ -1,3 +1,5 @@ |
| 10 | +#encoding: ASCII-8BIT |
| 11 | + |
| 12 | # module : base/switch |
| 13 | # copyright : PRAGMA Advanced Document Engineering |
| 14 | # version : 2002-2005 |
| 15 | @@ -488,7 +490,7 @@ class CommandLine |
| 16 | def dirtyvalue(value) |
| 17 | if value then |
| 18 | value.gsub(/([\"\'])(.*?)\1/) do |
| 19 | - $2.gsub(/\s+/o, "\xFF") |
| 20 | + $2.gsub(/\s+/o, "\0xFF") |
| 21 | end |
| 22 | else |
| 23 | '' |
| 24 | @@ -498,7 +500,7 @@ class CommandLine |
| 25 | def cleanvalue(value) |
| 26 | if value then |
| 27 | # value.sub(/^([\"\'])(.*?)\1$/) { $2.gsub(/\xFF/o, ' ') } |
| 28 | - value.gsub(/\xFF/o, ' ') |
| 29 | + value.gsub(/\0xFF/o, ' ') |
| 30 | else |
| 31 | '' |
| 32 | end |
| 33 | @@ -567,7 +569,7 @@ class CommandLine |
| 34 | |
| 35 | def locateseries(series, value) |
| 36 | |
| 37 | - series.each do |key| |
| 38 | + series.each_char do |key| |
| 39 | locatesingle(key,cleanvalue(value)) |
| 40 | end |
| 41 | |