Re: [9.3 bug fix] ECPG does not escape backslashes

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: MauMau <maumau307(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [9.3 bug fix] ECPG does not escape backslashes
Date: 2013-07-04 11:58:39
Message-ID: 51D5636F.8040602@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 07/04/2013 07:04 AM, Michael Meskes wrote:
> On Wed, Jul 03, 2013 at 07:22:48PM +0900, MauMau wrote:
>> I happened to find a trivial bug of ECPG while experimenting with
>> 9.3 beta 2. Please find attached the patch to fix this. This is
>> not specific to 9.3. Could you commit and backport this?
> This appears to be Windows specific. I don't have a Windows system to test
> with. How does Visusal Studio handle #line entries with full path names? Are
> they all escaped? Or better do they have to be?
>
>> This is necessary not only on Windows but also on UNIX/Linux. For
>> your information, running "gcc -E di\\r/a.c" escapes \ and outputs
>> the line:
>>
>> # 1 "di\\r/a.c"
> Now this statement surprises me:
>
> michael(at)feivel:~$ ecpg test\\\\a/init.pgc
> michael(at)feivel:~$ grep line test\\\\a/init.c |head -1
> #line 1 "test\\a/init.pgc"
> michael(at)feivel:~$ gcc -o i test\\\\a/init.c -I /usr/include/postgresql/ -l ecpg
> michael(at)feivel:~$
>
> This seems to suggest that it works nicely on Linux.
>

Really? I'd expect to see 4 backslashes in the #line directive, I think.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KONDO Mitsumasa 2013-07-04 12:28:11 Re: Improvement of checkpoint IO scheduler for stable transaction responses
Previous Message Michael Meskes 2013-07-04 11:04:07 Re: [9.3 bug fix] ECPG does not escape backslashes