[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Re: Problem with ifeq under 2.0.0
- From: Denis Barbier <nospam@thanx>
- Date: Fri, 19 May 2000 00:56:52 +0200 (CET)
On Thu, 18 May 2000, Roland Rosenfeld wrote:
> On Wed, 17 May 2000, Denis Barbier wrote:
>
> > read the file README.mp4h in top-level directory, it describes what to
> > do with this expression (and why it is broken now):
> > <ifeq 0 0 <img src="foo.png" alt="">>
>
> But there is still a strange effect in combination with
> wml::std::href:
>
> Take this example:
>
> #include wml::std::href
> <ifeq 0 0 "<href url=\"foo.html\">" "<href url=\"bar.html\">">
>
> This results in
> <a href=""foo.html""><tt>"foo.html"</tt></a>
> (note the superfluous quotes).
Indeed this form is no more valid. The patch below allows it, but it
won't work when nesting more levels.
> In contrast to this, the following seems to be okay:
>
> #include wml::std::href
> <ifeq 0 0 "<href url="foo.html">" "<href url="bar.html">">
Yes, this is indeed the right way.
> and also
>
> #include wml::std::href
> <ifeq 0 0 "<href url=foo.html>" "<href url=bar.html>">
>
> Both create the expected output:
>
> <a href="foo.html"><tt>foo.html</tt></a>
>
> But why does it work this way? This isn't what I expected after
> reading README.mp4h and the manpage of wml::std::href...
In this case README.mp4h must be rewritten. I'll try to find a better
formulation.
--- wml_backend/p2_mp4h/src/builtin.c 2000/05/02 22:34:46 1.37
+++ wml_backend/p2_mp4h/src/builtin.c 2000/05/18 22:50:14
@@ -3117,7 +3117,8 @@
}
/* Remove special quote characters. */
- if (*value == CHAR_LQUOTE && *(value+strlen(value)-1) == CHAR_RQUOTE)
+ if ((*value == CHAR_LQUOTE && *(value+strlen(value)-1) == CHAR_RQUOTE)
+ || (*value == CHAR_QUOTE && *(value+strlen(value)-1) == CHAR_QUOTE))
{
*(value+strlen(value)-1) = '\0';
value++;
--
Denis Barbier
WML Maintainer
______________________________________________________________________
Website META Language (WML) www.engelschall.com/sw/wml/
Official Support Mailing List sw-wml@engelschall.com
Automated List Manager majordomo@engelschall.com