Skip to content

Commit

Permalink
Handle lines with leading whitespace properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac G committed Mar 13, 2012
1 parent e55c9a1 commit ffef453
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion urltitles.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
sub message_public {
my ($server, $msg, $nick, $mask, $target) = @_;

my $out = "";
my ($word, $ws, $title, $response);
$msg =~ s/^(\s*)//; # Strip leading spaces at the begining of the line
my $out = $1;
while ($msg =~ m/\G(\S+)(\s*)/g)
{
($word, $ws) = ($1, $2); # word, whitespace
Expand Down

0 comments on commit ffef453

Please sign in to comment.