From 690d6094989048801b246ca25635230cbe15fef7 Mon Sep 17 00:00:00 2001 From: ian Date: Sun, 3 May 2009 17:02:17 +0000 Subject: [PATCH] correctly detect unspecified initial H --- layout/slopecalc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/layout/slopecalc b/layout/slopecalc index 2c113e9..4fb1145 100755 --- a/layout/slopecalc +++ b/layout/slopecalc @@ -100,7 +100,7 @@ sub complete_current_point ($) { my $say_why= 0; my $this= $cp[$#cp]; - my $last= $cp[$#cp-1]; + my $last= @cp > 1 ? $cp[$#cp-1] : undef; foreach my $k2 (qw(S L H)) { if (defined $last) { no strict 'refs'; @@ -136,8 +136,11 @@ sub arg_item ($$) { push @cp, $this; } +#use Data::Dumper; + sub parse_args () { foreach $_ (@ARGV) { +#print STDERR ">$_<\n", Dumper(\@cp); if (m/^\=([-+]?$numre)$/o) { arg_item(H, $1); } elsif (m/^([-+]?$numre)\%$/o) { -- 2.30.2