File: topic-diff.pl.diff

package info (click to toggle)
irssi-scripts 20120326
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,500 kB
  • sloc: perl: 60,045; sh: 146; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 733 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Description: topic-diff.pl: ignore trailing whitespace changes, and also recognize ' - ' as separator
Forwarded: no
Author: Christoph Berg <myon@debian.org>
Last-Update: 2006-07-22
--- a/scripts/topic-diff.pl
+++ b/scripts/topic-diff.pl
@@ -30,8 +30,10 @@
 #    $server->print ($channel, $server->{tag});
 
     if ($topics{$server->{tag}."_".$channel}) {
-	my @original = split /\s*\|\s*/, $topics{$server->{tag}."_".$channel};
-	my @modified = split /\s*\|\s*/, $topic;
+	$topics{$server->{tag}."_".$channel} =~ s/^ +| +$//g;
+	$topic =~ s/^ +| +$//g;
+	my @original = split /\s*\|\s*|\s+-\s+/, $topics{$server->{tag}."_".$channel};
+	my @modified = split /\s*\|\s*|\s+-\s+/, $topic;
 	
 	
       outer: while( $i <= $#original) {