From: Tietew Date: 2004-11-08T12:10:45+09:00 Subject: [ruby-dev:24741] infinite loop in shellword.rb Shellwords.shellwords("\\") が無限ループします。 Index: lib/shellwords.rb =================================================================== RCS file: /src/ruby/lib/shellwords.rb,v retrieving revision 1.7 diff -u -2 -r1.7 shellwords.rb --- lib/shellwords.rb 26 Jan 2003 10:11:30 -0000 1.7 +++ lib/shellwords.rb 8 Nov 2004 03:07:29 -0000 @@ -42,6 +42,6 @@ elsif line =~ /\A'/ then raise ArgumentError, "Unmatched single quote: #{line}" - elsif line.sub!(/\A\\(.)/, '') then - snippet = $1 + elsif line.sub!(/\A\\(.)?/, '') then + snippet = $1 || '\\' elsif line.sub!(/\A([^\s\\'"]+)/, '') then snippet = $1 ash -c 'echo \' が \ を印字したのでこのように変更しましたが、 bash -c 'echo \' は何も印字しませんでした。どっちがいいんでしょ う。 —[ Tietew ]—————————————————————————— メ : tietew@tietew.net / tietew@raug.net / tietew@masuclub.net ホペ: http://www.tietew.net/ Tietew Windows Lab. http://www.masuclub.net/ 鱒倶楽部 指紋: 26CB 71BB B595 09C4 0153 81C4 773C 963A D51B 8CAA