added help for chat
[spider.git] / cmd / apropos.pl
index 8e4d4eb24fff17d4943e3db394bb13b3038b5771..ac1d0f609a9ea792e429b5351f8bbe66170803ca 100644 (file)
@@ -30,7 +30,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")) {
@@ -44,6 +44,7 @@ my $include;
 foreach $in (<$defh>) {
        next if $in =~ /^\#/;
        chomp $in;
+       $in =~ s/\r$//;
        if ($in =~ /^===/) {
                $cmd{$cmd} = "$cmd $desc" if $include;
                $include = 0;
@@ -55,7 +56,7 @@ foreach $in (<$defh>) {
                $include = 1;
                next;
        }
-       $include =~ 1 if $cmd =~ /$line/i;
+       $include = 1 if $cmd =~ /$line/i;
 }
 $cmd{$cmd} = "$cmd $desc" if $include;
 $defh->close;
@@ -66,6 +67,7 @@ if ($h) {
        foreach $in (<$h>) {
                next if $in =~ /^\#/;
                chomp $in;
+               $in =~ s/\r$//;
                if ($in =~ /^===/) {
                        $cmd{$cmd} = "$cmd $desc" if $include;
                        $include = 0;
@@ -77,7 +79,7 @@ if ($h) {
                        $include = 1;
                        next;
                }
-               $include =~ 1 if $cmd =~ /$line/i;
+               $include = 1 if $cmd =~ /$line/i;
        }
        $cmd{$cmd} = "$cmd $desc" if $include;
        $h->close;