]> git.donarmstrong.com Git - infobot.git/commitdiff
more fixups.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 3 Feb 2001 14:46:58 +0000 (14:46 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sat, 3 Feb 2001 14:46:58 +0000 (14:46 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@321 c11ca15a-4712-0410-83d8-924469b57eb5

src/Modules/UserDCC.pl

index 5085751469422c0bb487097f2838aa53ce888316..894f0d4d9feb5139e77695cf8f4eedbcbe0b60f9 100644 (file)
@@ -499,10 +499,9 @@ sub userDCC {
        }
 
        my $update      = 0;
-       ### TODO: $what can be undefined. fix it!
-       if ($what =~ s/^\+(\S+)/$1/) {
+       if (defined $what and $what =~ s/^\+(\S+)/$1/) {
            my $was     = $chanconf{$chan}{$1};
-           if ($was eq "1") {
+           if (defined $was and $was eq "1") {
                &pSReply("setting $what for $chan already 1.");
                return;
            }
@@ -513,7 +512,7 @@ sub userDCC {
            $chanconf{$chan}{$what} = 1;
 
            $update++;
-       } elsif ($what =~ s/^\-(\S+)/$1/) {
+       } elsif (defined $what and $what =~ s/^\-(\S+)/$1/) {
            my $was     = $chanconf{$chan}{$1};
            # hrm...
            if (!defined $was) {
@@ -534,7 +533,7 @@ sub userDCC {
            $update++;
        } elsif (defined $val) {
            my $was     = $chanconf{$chan}{$what};
-           if ($was eq $val) {
+           if (defined $was and $was eq $val) {
                &pSReply("setting $1 for $chan already '$val'.");
                return;
            }
@@ -599,7 +598,7 @@ sub userDCC {
            $delete     = ($1) ? 1 : 0;
            &DEBUG("chan => $chan.");
        } else {
-           &DEBUG("no chan arg; setting to default.");
+           &VERB("no chan arg; setting to default.",2);
            $chan       = "_default";
        }