summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2008-06-05 16:16:05 +0000
committerAndreas Brachold <vdr07@deltab.de>2008-06-05 16:16:05 +0000
commite0f26f2298ce7a9cdd570cd6f63ee55830bc3b0e (patch)
tree7a854f9fe907b2e3da3c54a7c82e4155e0bec4c4
parenta6e275f794e1339a2d4002fc911087da844cf515 (diff)
downloadxxv-e0f26f2298ce7a9cdd570cd6f63ee55830bc3b0e.tar.gz
xxv-e0f26f2298ce7a9cdd570cd6f63ee55830bc3b0e.tar.bz2
* CHANNELS: Request[13950] Missing group delimiter without number for next channel
-rw-r--r--lib/XXV/MODULES/CHANNELS.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/XXV/MODULES/CHANNELS.pm b/lib/XXV/MODULES/CHANNELS.pm
index b1e7c1a..7c9b579 100644
--- a/lib/XXV/MODULES/CHANNELS.pm
+++ b/lib/XXV/MODULES/CHANNELS.pm
@@ -423,8 +423,13 @@ sub readData {
next if($line eq "");
- if($line =~ /250[\-|\s]0\s/) { # Channels groups
- ($nPos, $grpText) = $line =~ /^250[\-|\s]0\s\:\@(\d+)\s(.+)/si;
+ # 250-0 ... it's a group delimiter
+ if($line =~ /^250[\-|\s]0\s/) {
+ if($line =~ /^250[\-|\s]0\s\:\@\d+\s/) { # Entry to specify the number of the next channel
+ ($nPos, $grpText) = $line =~ /^250[\-|\s]0\s\:\@(\d+)\s(.+)/si;
+ } else { # Entry without specify the number of the next channel
+ ($grpText) = $line =~ /^250[\-|\s]0\s\:(.+)/si;
+ }
if(exists $grp_data->{$nPos}) {
if($grp_data->{$nPos}->{Name} ne $grpText) {
$grp = $obj->insertGrp($nPos, $grpText);
@@ -435,9 +440,10 @@ sub readData {
} else {
$grp = $obj->insertGrp($nPos, $grpText);
}
+ # 250-x ... it's channel x
} else {
- # Insert first group
- unless($grp) {
+
+ unless($grp) { # Insert a default group delimiter
$grp = 1;
if(exists $grp_data->{$grp}) {
$grpText = gettext("Channels");
@@ -450,6 +456,7 @@ sub readData {
}
}
+ # parse channel line
($nPos, $channelText) = $line =~ /^250[\-|\s](\d+)\s(.+)/si;
my @data = split(':', $channelText, 13);