From fa082787da16b88f65ad28f9f0e5ec02b8b9e34a Mon Sep 17 00:00:00 2001 From: freesource Date: Sun, 21 Oct 2001 06:53:36 +0000 Subject: [PATCH] This doesn't permit "" values to be put into the history since ReadLine complains about this. Just checks that arg isn't "". --- SWIM/Safex.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SWIM/Safex.pm b/SWIM/Safex.pm index 821737a..3bda335 100644 --- a/SWIM/Safex.pm +++ b/SWIM/Safex.pm @@ -881,6 +881,7 @@ sub history { push(@HISTORY,$line); undef $line; } + return @HISTORY; } # end sub history @@ -903,15 +904,14 @@ sub history_print { my @HISTORY = ; close(HISTORY); if ($#HISTORY < $HISTORY - 1) { - push(@HISTORY,"$arg\n"); + push(@HISTORY,"$arg\n") if $arg; } else { shift(@HISTORY); - push(@HISTORY,"$arg\n"); + push(@HISTORY,"$arg\n") if $arg; } open(HISTORY,">$swim_history") or exit; print HISTORY @HISTORY; - } # end sub history_print