Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit15364ea

Browse files
author
Michael Meskes
committed
Changed statement escaping to not escape continuation line markers.
1 parentf4b7624 commit15364ea

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2327,3 +2327,8 @@ Sun, 02 Mar 2008 11:50:48 +0100
23272327

23282328
- Fixed bug that caused arrays of varchar to be output with incomplete
23292329
name.
2330+
2331+
Thu, 20 Mar 2008 16:54:27 +0100
2332+
2333+
- Changed statement escaping to not escape continuation line markers.
2334+

‎src/interfaces/ecpg/preproc/output.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/output.c,v 1.23 2007/11/15 21:14:45 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/output.c,v 1.24 2008/03/20 15:56:59 meskes Exp $ */
22

33
#include"postgres_fe.h"
44

@@ -193,7 +193,18 @@ output_escaped_str(char *str, bool quoted)
193193
elseif (str[i]=='\n')
194194
fputs("\\\n",yyout);
195195
elseif (str[i]=='\\')
196-
fputs("\\\\",yyout);
196+
{
197+
intj=i;
198+
199+
/* check whether this is a continuation line
200+
* if it is, do not output anything because newlines are escaped anyway */
201+
202+
/* accept blanks after the '\' as some other compilers do too */
203+
do {j++; }while (str[j]==' '||str[j]=='\t');
204+
205+
if ((str[j]!='\n')&& (str[j]!='\r'||str[j+1]!='\n'))/* not followed by a newline */
206+
fputs("\\\\",yyout);
207+
}
197208
elseif (str[i]=='\r'&&str[i+1]=='\n')
198209
{
199210
fputs("\\\r\n",yyout);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp