[9.3 bug fix] ECPG does not escape backslashes

Поиск
Список
Период
Сортировка
От MauMau
Тема [9.3 bug fix] ECPG does not escape backslashes
Дата
Msg-id A0C361567285450883C37D254F58F054@maumau
обсуждение исходный текст
Ответы Re: [9.3 bug fix] ECPG does not escape backslashes
Re: [9.3 bug fix] ECPG does not escape backslashes
Список pgsql-hackers
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

Вложения

В списке pgsql-hackers по дате отправления: