Always better to include the patch, isn't it?

So here it is.

-- 
+-----------------------------------------------+
| Philippe M. Chiasson  <[EMAIL PROTECTED]>        |
| SmartWorker http://www.smartworker.org        |
|     IM : gozerhbe  ICQ : gozer/99685021       |
|   64.8% computer corrupt according to         |
| http://www.freespeech.org/ljk/purity.html     |
+-----------------------------------------------+
If ease of use is the highest goal, we should all be
driving golf carts. 
        -- Larry Wall

perl -e '$$=\${gozer};{$_=unpack(P26,pack(L,$$));/^Just Another Perl 
Hacker!\n$/&&print||$$++&&redo}'
--- Inline/Struct.pm.orig       Fri Jun 29 14:11:30 2001
+++ Inline/Struct.pm    Sun Jul  1 12:40:40 2001
@@ -231,7 +231,7 @@
                           $type,
                           "output_expr",
                           1,
-                         );
+                         ) || '';
            $INITL .=
              (typeconv($o, "targ->$field",
                            "ST($i)",
@@ -242,6 +242,7 @@
               "; \\\n");
            $INITA .= qq{$q(i == ${\($i-1)}) \\\n$t; \\\n};
            $INITH .= qq{$q(strEQ(k, "$field")) \\\n$t;\\\n};
+               
            $HASH .= (qq{{\\\n\tSV*tmp=newSViv(0);\\\n$s \\
 \thv_store(targ, "$field", $flen, tmp, 0); \\\n}} .
                      ($i == $maxi ? "" : "\\") .
@@ -264,15 +265,15 @@
                "\tSV *retval = newSViv(0);\n" .
                "    PPCODE:\n" .
                "\tif (items != 1) {\n" .
-               typeconv($o, "object->$field",
+               (typeconv($o, "object->$field",
                             "ST(1)",
                             $type,
                             "input_expr",
-                           ) . ";\n" .
-               typeconv($o, "object", "retval", "$cname *", "output_expr")."\n" .
+                           ) || '' ) . ";\n" .
+               (typeconv($o, "object", "retval", "$cname *", "output_expr") || '') . 
+"\n" .
                "\t}\n" .
                "\telse {\n" .
-               typeconv($o, "object->$field", "retval", $type, "output_expr") .
+               (typeconv($o, "object->$field", "retval", $type, "output_expr") || '') 
+.
                "\n\t}\n\t" .
                "XPUSHs(retval);\n\n"
               );
@@ -345,8 +346,11 @@
     my $tkind = $o->{ILSM}{typeconv}{type_kind}{$type};
     my $ret =
       eval qq{qq{$o->{ILSM}{typeconv}{$dir}{$tkind}}};
-    chomp $ret;
-    $ret =~ s/\n/\\\n/g if $preproc;
+       if(defined $ret)
+               {
+       chomp $ret;
+       $ret =~ s/\n/\\\n/g if $preproc;
+               }
     return $ret;
 }
 

Reply via email to