httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: [multi-env] illegal escape sequence
Date Thu, 17 Feb 2005 05:27:56 GMT
Randy Kobes <randy@theoryx5.uwinnipeg.ca> writes:

[...]

> which is OK. However
>
> int main(void) {
>    const char bar[] = QUOTE_ME("domain=\"example.com\"");
>    printf("bar is %s\n", bar);
>    return 0;
> }
>
> expands to
>
> int main(void) {
>    const char bar[] = "\"domain=\\\"example.com\\"\"";
>    printf("bar is %s\n", bar);
>    return 0;
> }
>
> which explains the "illegal escape sequence" error.
> This is with VC++ 6 (with gcc, both the above are fine).
>
> I'll keep looking for solutions ...

Nice work- so it chokes on the final escaped quote, 
right?  See what it does with a single, escaped quote 
char:

    QUOTE_ME("\"")

If it escapes that properly, you *might* be able to 
get somewhere by breaking the string literal into two
pieces:

    QUOTE_ME("domain=\"example.com" "\"")

or 

   QUOTE_ME("domain=\"example.com") QUOTE_ME("\"")

-- 
Joe Schaefer


Mime
View raw message