Hello,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?
[Bug description] Running "ecpg c:\command\a.pgc" produces the following line in a.c: #line 1 "c:\command\a.pgc"Then, compiling the resulting a.c with Visual Studio (cl.exe) issues the warning:
a.c(8) : warning C4129: 'c' : unrecognized character escape sequence This is because ecpg doesn't escape \ in the #line string. [How to fix] Escape \ in the input file name like this: #line 1 "c:\\command\\a.pgc"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" Regards MauMau
ecpg_line.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers