diff options
| author | Tom Feist <shabble@metavore.org> | 2011-07-16 05:01:23 +0000 | 
|---|---|---|
| committer | Tom Feist <shabble@metavore.org> | 2011-07-16 05:01:23 +0000 | 
| commit | 8c4633404a694388c95dd01f7895b506b57bfb19 (patch) | |
| tree | c15fca93f8440a6e9afe0712b28e2299397caa9f | |
| parent | getchan now actually parses the channel data (diff) | |
| download | irssi-scripts-8c4633404a694388c95dd01f7895b506b57bfb19.tar.gz irssi-scripts-8c4633404a694388c95dd01f7895b506b57bfb19.zip | |
fix code-paths not properly stopping the print text signal
| -rw-r--r-- | feature-tests/getchan.pl | 12 | 
1 files changed, 8 insertions, 4 deletions
| diff --git a/feature-tests/getchan.pl b/feature-tests/getchan.pl index cb3920d..622f708 100644 --- a/feature-tests/getchan.pl +++ b/feature-tests/getchan.pl @@ -113,7 +113,11 @@ sub get_channels {  sub restore_formats {      Irssi::command("^FORMAT chansetup_line $line_format");      Irssi::command("^FORMAT chansetup_header $head_format"); -    Irssi::command("^FORMAT chansetup_footer $foot_format"); +    if ($foot_format =~ m/^\s*$/) { +        Irssi::command("^FORMAT -reset chansetup_footer"); +    } else { +        Irssi::command("^FORMAT  chansetup_footer $foot_format"); +    }  }  sub sig_print_text { @@ -123,7 +127,6 @@ sub sig_print_text {      if ($state == 0 && $text =~ m/START/) {          $state = 1; -        return;      } elsif ($state == 1) {          # TODO: might we get multiple lines at once?          if ($text =~ m/channel:([^\t]+)\tnet:([^\t]+)\tpass:([^\t]*)\tsettings:(.*)$/) { @@ -134,14 +137,14 @@ sub sig_print_text {              my $tag = "$2/$1";              $channels->{$tag} = $entry; -            Irssi::signal_stop(); +          } elsif ($text =~ m/END/) {              $state = 0; -            return;          } else {              push @errors, "Failed to parse: '$text'";          }      } +    Irssi::signal_stop();  }  sub go { @@ -155,6 +158,7 @@ sub go {          restore_formats();      }      if (@errors) { +        @errors = map { s/\t/    /g } @errors;          print Dumper(\@errors);      }      print Dumper($channels); | 
