[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
[BUG REPORT] WML 2.0.2, Linux 2.0.36
- From: nospam@thanx
- Date: Tue, 10 Apr 2001 17:45:49 +0200 (MET DST)
BUG REPORT
Package: WML 2.0.2
Operating System: Linux 2.0.36
Problem Description:
| Short Description : when a source file contains a
| <protect 9> zone, its code is never dumped on
| STDOUT if ones want to dump on STDOUT and on
| a classical outputfile.
|
|
| [nota. I checked more recent versions of WML (>2.02)
| and the bug listed below is still there]
|
| Long Description, and hack :
|
| Try to wml this file :
| -------------------%<---------------
| #!wml --outputfile=ALL:- --outputfile=ALL:protect9.html
|
| aaa
|
| <protect pass=9>
| bbb
| </protect>
| -------------------%<---------------
|
| This gives :
|
| ----------------------
| % wml protect9.wml
| aaa
| -=P[000000]=-
| % more protect9.html
| aaa
|
| bbb
| %
| ----------------------
|
| See what happens ? The <protect 9> part dumped
| to STDOUT get never unprotected.
|
| This happens only when one wants a STDOUT && one
| or more classical outputfiles in the same run.
| This is due to the fact that in the wml frontend,
| the subroutine ProcessOutfiles does not treat STDOUT
| fairly, imho : STDOUT is not included in the
| @outfiles array.
|
| A first (working) hack is to :
|
| 1. create a new variable before ProcessOutFiles :
| $tmpstdout = "$tmpdir/wml.$$.tmpstdout" . $src_suffix;
|
| 2. in ProcessOutFiles, defer the build of $out
| after the if clauses :
|
| #$out .= " -o '"."earg($o)."'"; # before hack
| $prepout = " -o '"."earg($o)."'"; # after hack
| .
| .
| .
| if...elsif...else
| $out .= $prepout; # after hack
|
| 3. in each if/elsif part, treat the STDOUT (aka
| '-') case. For instance :
|
| if ($o =~ m|^([_A-Z0-9*~!+u%n\-\\^x()@]+):(.+)\@(.+)$|) {
| push(@outfiles, $2) if ($2 ne '-');
| if ($2 eq '-') {push(@outfiles, $tmpstdout);
| $prepout =~ s|^ -o '([_A-Z0-9*~!+u%n\-\\^x()@]+):(.+)\@(.+)'$| -o '$1:$tmpstdout\@$3'|;}
| }
| }
|
| 4. don't forget to dump on STDOUT then unlink $tmpstdout
| when time comes, ie just after &unlink_tmp(); at the end
| of the wml script :
|
| if (-e $tmpstdout)
| {
| # dump it to STDOUT then unlink
| open(TMP, $tmpstdout);
| while (<TMP>) {
| print $_;
| }
| close(TMP);
|
| unlink($tmpstdout);
| }
|
|
______________________________________________________________________
Website META Language (WML) www.engelschall.com/sw/wml/
Official Support Mailing List sw-wml@engelschall.com
Automated List Manager majordomo@engelschall.com