fix console.pl max scroll depth
[spider.git] / cmd / help.pl
index b44457b8b81bb8fe6721344781616ce9f85e863a..cc9eee3a1cf3d32e58d3b090212c373b0614d619 100644 (file)
@@ -7,7 +7,7 @@
 #
 # Copyright (c) 1998 - Dirk Koopman G1TLH
 #
-# $Id$
+#
 #
 
 my ($self, $line) = @_;
@@ -31,6 +31,9 @@ $lang = 'en' if !$lang;
 # The fields are:- privilege level, full command name, short description
 #
 
+#$DB::single = 1;
+
+
 my $defh = new IO::File;
 unless ($defh->open("$main::localcmd/Commands_en.hlp")) {
        unless($defh->open("$main::cmd/Commands_en.hlp")) {
@@ -39,7 +42,7 @@ unless ($defh->open("$main::localcmd/Commands_en.hlp")) {
 }
 
 my $h;
-unless ($lang ne 'en') {
+if ($lang ne 'en') {
        $h = new IO::File;
        unless ($h->open("$main::localcmd/Commands_$lang.hlp")) {
                unless($h->open("$main::cmd/Commands_$lang.hlp")) {
@@ -56,7 +59,7 @@ my $in;
 $line =~ s{[^\w/]}{}g;
 $line =~ s{/}{.*/}g;
 $line =~ s/^\s+//g;
-$line =~ s/\s+$//g;
+$line =~ s/[\s\r]+$//g;
 $line = "help" if $line =~ /^\s*$/;
 
 # sort out aliases
@@ -69,6 +72,7 @@ if ($h) {
        foreach $in (<$h>) {
                next if $in =~ /^\#/;
                chomp $in;
+               $in =~ s/\r$//;
                if ($in =~ /^===/) {
                        last if $state == 2;           # come out on next command
                        $in =~ s/=== //;