xsubpp incorrectly handles 'class::newthing()'
authorJohn Q. Linux <jql@jql.accessone.com>
Sat, 12 Apr 1997 22:01:33 +0000 (15:01 -0700)
committerChip Salzenberg <chip@atlantic.net>
Mon, 14 Apr 1997 12:00:00 +0000 (00:00 +1200)
private-msgid: 199704122201.PAA01780@jql.accessone.com

lib/ExtUtils/xsubpp

index 0cc8d78..aa46b28 100755 (executable)
@@ -821,7 +821,8 @@ while (fetch_para()) {
 
     @args = split(/\s*,\s*/, $orig_args);
     if (defined($class)) {
-       my $arg0 = ((defined($static) or $func_name =~ /^new/) ? "CLASS" : "THIS");
+       my $arg0 = ((defined($static) or $func_name eq 'new')
+                   ? "CLASS" : "THIS");
        unshift(@args, $arg0);
        ($orig_args = "$arg0, $orig_args") =~ s/^$arg0, $/$arg0/;
     }
@@ -928,7 +929,7 @@ EOF
 EOF
        
        if (!$thisdone && defined($class)) {
-           if (defined($static) or $func_name =~ /^new/) {
+           if (defined($static) or $func_name eq 'new') {
                print "\tchar *";
                $var_types{"CLASS"} = "char *";
                &generate_init("char *", 1, "CLASS");
@@ -973,13 +974,13 @@ EOF
                                $wantRETVAL = 1;
                        }
                        if (defined($static)) {
-                           if ($func_name =~ /^new/) {
+                           if ($func_name eq 'new') {
                                $func_name = "$class";
                            } else {
                                print "${class}::";
                            }
                        } elsif (defined($class)) {
-                           if ($func_name =~ /^new/) {
+                           if ($func_name eq 'new') {
                                $func_name .= " $class";
                            } else {
                                print "THIS->";