Skip to content

Commit

Permalink
fix bounds on whitespace reduction
Browse files Browse the repository at this point in the history
The story_cache for Story i9u0aw has a line with 72 spaces. Subtracting that
from the line length of 72, that's 0, so the gsub regexp becomes /(.{1,0})/
and throws an exception.
  • Loading branch information
pushcx committed Aug 6, 2018
1 parent c05becb commit b835c25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion script/mail_new_activity
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class String
line
elsif (m = line.match(/^(> ?| +)(.*)/))
ind = m[1]
if len - ind.length < 0
if len - ind.length <= 0
ind = " "
end
m[2].gsub(/(.{1,#{len - ind.length}})(\s+|$)/, "#{ind}\\1\n").strip
Expand Down

0 comments on commit b835c25

Please sign in to comment.