[Bps-public-commit] Prophet - A disconnected, replicated p2p database branch, master, updated. 5c327a82876571512f12688f2e0074d06f765a5c
sartak at bestpractical.com
sartak at bestpractical.com
Tue Feb 17 15:35:06 EST 2009
The branch, master has been updated
via 5c327a82876571512f12688f2e0074d06f765a5c (commit)
from 0f9b1cfc081e0f7b87734a97a250ab0e08bafa04 (commit)
Summary of changes:
lib/Prophet/CLI.pm | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit 5c327a82876571512f12688f2e0074d06f765a5c
Author: Shawn M Moore <sartak at gmail.com>
Date: Tue Feb 17 15:35:01 2009 -0500
We don't need to store $pager
diff --git a/lib/Prophet/CLI.pm b/lib/Prophet/CLI.pm
index 7620fb7..7e499a5 100644
--- a/lib/Prophet/CLI.pm
+++ b/lib/Prophet/CLI.pm
@@ -167,7 +167,6 @@ sub get_pager {
}
our $ORIGINAL_STDOUT;
-our $pager;
sub start_pager {
my $self = shift;
@@ -176,11 +175,13 @@ sub start_pager {
local $ENV{'LESS'} = '-FXe';
local $ENV{'MORE'} = '-FXe';
- $pager = $self->get_pager();
+ my $pager = $self->get_pager();
return unless $pager;
open (my $cmd, "|-", $pager) || return;
$|++;
$ORIGINAL_STDOUT = *STDOUT;
+
+ # $pager will be closed once we restore STDOUT to $ORIGINAL_STDOUT
*STDOUT = $cmd;
}
}
@@ -193,8 +194,8 @@ sub end_pager {
my $self = shift;
return unless ($self->in_pager);
*STDOUT = $ORIGINAL_STDOUT ;
- close($pager);
- $pager = undef;
+
+ # closes the pager
$ORIGINAL_STDOUT = undef;
}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list