From: Kurt Starsinic Date: Mon, 10 Mar 2003 00:54:49 +0000 (-0500) Subject: [perl #20755] [PATCH] 5.8.0 h2ph barfs on checksum.h on RH6.2/7.2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ab5fe4d6aaf45c57b7af4b994a730291eee17efa;p=p5sagit%2Fp5-mst-13.2.git [perl #20755] [PATCH] 5.8.0 h2ph barfs on checksum.h on RH6.2/7.2 Message-ID: p4raw-id: //depot/perl@18963 --- diff --git a/t/lib/h2ph.h b/t/lib/h2ph.h index c60e8f0..f13b69c 100644 --- a/t/lib/h2ph.h +++ b/t/lib/h2ph.h @@ -121,4 +121,15 @@ enum flimflam { flam } flamflim; +/* Handle multi-line quoted strings: */ +__asm__ __volatile__(" + this + produces + no + output +"); + +#define multiline "multiline +string" + #endif /* _H2PH_H_ */ diff --git a/t/lib/h2ph.pht b/t/lib/h2ph.pht index 796d6a8..8bc1636 100644 --- a/t/lib/h2ph.pht +++ b/t/lib/h2ph.pht @@ -84,5 +84,6 @@ unless(defined(&_H2PH_H_)) { } eval("sub flim () { 0; }") unless defined(&flim); eval("sub flam () { 1; }") unless defined(&flam); + eval 'sub multiline () {"multilinestring";}' unless defined(&multiline); } 1; diff --git a/utils/h2ph.PL b/utils/h2ph.PL index f4b04f9..27a7bf6 100644 --- a/utils/h2ph.PL +++ b/utils/h2ph.PL @@ -489,10 +489,18 @@ sub next_line $out .= $1; } elsif ($in =~ s/^(\\.)//) { # \... $out .= $1; - } elsif ($in =~ s/^('(\\.|[^'\\])*')//) { # '... - $out .= $1; - } elsif ($in =~ s/^("(\\.|[^"\\])*")//) { # "... - $out .= $1; + } elsif ($in =~ /^'/) { # '... + if ($in =~ s/^('(\\.|[^'\\])*')//) { + $out .= $1; + } else { + next READ; + } + } elsif ($in =~ /^"/) { # "... + if ($in =~ s/^("(\\.|[^"\\])*")//) { + $out .= $1; + } else { + next READ; + } } elsif ($in =~ s/^\/\/.*//) { # //... # fall through } elsif ($in =~ m/^\/\*/) { # /*...