diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-01 02:45:47 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-01 02:45:47 +0000 |
| commit | 73a2009375f0dd2ee08548aaa66c486d0194c10f (patch) | |
| tree | efef0182c55f2ada14acb5ef482c6f2192eed45b /tool | |
| parent | 64fc6340e6d0ebdad8312911dc83ca999e585c22 (diff) | |
| download | ruby-73a2009375f0dd2ee08548aaa66c486d0194c10f.tar.gz ruby-73a2009375f0dd2ee08548aaa66c486d0194c10f.tar.xz ruby-73a2009375f0dd2ee08548aaa66c486d0194c10f.zip | |
* tool/compile_prelude.rb (C_ESC): use octal escape to avoid
"\x09for (;;) ..." to be interpret the first character 0x9f.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
| -rw-r--r-- | tool/compile_prelude.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tool/compile_prelude.rb b/tool/compile_prelude.rb index 2ffccc0d9..04ecdf444 100644 --- a/tool/compile_prelude.rb +++ b/tool/compile_prelude.rb @@ -16,8 +16,8 @@ C_ESC = { "\n" => '\n', } -0x00.upto(0x1f) {|ch| C_ESC[[ch].pack("C")] ||= "\\x%02x" % ch } -0x7f.upto(0xff) {|ch| C_ESC[[ch].pack("C")] = "\\x%02x" % ch } +0x00.upto(0x1f) {|ch| C_ESC[[ch].pack("C")] ||= "\\%03o" % ch } +0x7f.upto(0xff) {|ch| C_ESC[[ch].pack("C")] = "\\%03o" % ch } C_ESC_PAT = Regexp.union(*C_ESC.keys) def c_esc(str) |
