Patches: Browse | Submit New | Admin

[#12380] Subject containting #@ breaks with Ruby 1.8

Date:
2007-07-18 18:18
Priority:
3
Submitted By:
Nobody
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Subject containting #@ breaks with Ruby 1.8

Detailed description
In gmailer.rb:284,

tmp = eval(x.gsub(",,",",'',").gsub(",,",",'',").gsub(",]",",'']&
quot;).gsub('#{','#\{'))

Only deal with '#{' is not enough.

irb(main):009:0> x = "#@"
SyntaxError: compile error
(irb):9: parse error, unexpected $undefined.
x = "#@"
       ^
(irb):9: unterminated string meets end of file
        from (irb):9
        from :0

It works better for me to simply escape # with \#, i.e., gsub('#','\#') as Ruby handles the escape correctly.

irb(main):001:0> x = "\#\#"       
=> "##"
irb(main):002:0> x = "\#@"
=> "\#@"
irb(main):003:0> x = "\#1234"
=> "#1234"

Add A Comment: Notepad

Please login


Followup

Message
Date: 2007-11-07 14:17
Sender: Park Heesob 

I committed in cvs.

Thanks,

Park Heesob

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item