Re: [9.3 bug fix] ECPG does not escape backslashes - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: [9.3 bug fix] ECPG does not escape backslashes
Date
Msg-id 51D56F9A.4060303@dunslane.net
Whole thread Raw
In response to Re: [9.3 bug fix] ECPG does not escape backslashes  (Michael Meskes <meskes@postgresql.org>)
Responses Re: [9.3 bug fix] ECPG does not escape backslashes
List pgsql-hackers
On 07/04/2013 08:31 AM, Michael Meskes wrote:
> On Thu, Jul 04, 2013 at 07:58:39AM -0400, Andrew Dunstan wrote:
>>> michael@feivel:~$ grep line test\\\\a/init.c |head -1
>>> #line 1 "test\\a/init.pgc"
>> ...
>>
>> Really? I'd expect to see 4 backslashes in the #line directive, I think.
> Eh, why? The four backslashes come are two that are escaped for shell usage.
> The directory name is in my example was "test\\a". What did I miss?
>

Isn't the argument to #line a C string literal in which one would expect 
backslashes to be escaped? If not, how would it show a filename 
containing a '"' character?
   [andrew@emma inst.92.5701]$ bin/ecpg x\\\"a/y.pgc   [andrew@emma inst.92.5701]$ grep line  x\\\"a/y.c   #line 1
"x\"a/y.pgc"

This must surely be wrong.


cheers

andrew




pgsql-hackers by date:

Previous
From: Dev Kumkar
Date:
Subject: Grouping Sets
Next
From: Andres Freund
Date:
Subject: Re: [9.3 bug fix] ECPG does not escape backslashes