mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-22 00:15:46 -07:00
Patch from Ben Hutchings to prevent an ugly special case in
&splitline in which a line is `split' into a line ending in a backslash followed by a completely blank line. [originally from svn r6710]
This commit is contained in:
@ -325,7 +325,8 @@ sub splitline {
|
|||||||
$splitchar = (defined $splitchar ? $splitchar : '\\');
|
$splitchar = (defined $splitchar ? $splitchar : '\\');
|
||||||
while (length $line > $len) {
|
while (length $line > $len) {
|
||||||
$line =~ /^(.{0,$len})\s(.*)$/ or $line =~ /^(.{$len,}?\s(.*)$/;
|
$line =~ /^(.{0,$len})\s(.*)$/ or $line =~ /^(.{$len,}?\s(.*)$/;
|
||||||
$result .= $1 . " ${splitchar}\n\t\t";
|
$result .= $1;
|
||||||
|
$result .= " ${splitchar}\n\t\t" if $2 ne '';
|
||||||
$line = $2;
|
$line = $2;
|
||||||
$len = 60;
|
$len = 60;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user