Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6a78d75

Browse files
author
Michael Meskes
committed
Changed statement escaping to not escape continuation line markers.
Bumped precompiler patchlevel.
1 parent 59c4fc5 commit 6a78d75

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,3 +2322,13 @@ Sun, 17 Feb 2008 18:45:39 +0100
23222322
- Removed duplicate include of ecpgtype.h.
23232323
- Changed INFORMIX mode symbol definition yet again because the old
23242324
way didn't work on NetBSD.
2325+
2326+
Sun, 02 Mar 2008 11:50:48 +0100
2327+
2328+
- Fixed bug that caused arrays of varchar to be output with incomplete
2329+
name.
2330+
2331+
Thu, 20 Mar 2008 16:54:27 +0100
2332+
2333+
- Changed statement escaping to not escape continuation line markers.
2334+
- Bumped ecpg version number to 4.4.1.

src/interfaces/ecpg/preproc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1998-2008, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.130 2008/01/01 19:45:59 momjian Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.130.2.1 2008/03/20 16:04:52 meskes Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -15,7 +15,7 @@ include $(top_builddir)/src/Makefile.global
1515

1616
MAJOR_VERSION= 4
1717
MINOR_VERSION= 4
18-
PATCHLEVEL=0
18+
PATCHLEVEL=1
1919

2020
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
2121
-I$(srcdir) -DMAJOR_VERSION=$(MAJOR_VERSION) \

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.23.2.1 2008/03/20 16:04:52 meskes Exp $ */
22

33
#include "postgres_fe.h"
44

@@ -193,7 +193,18 @@ output_escaped_str(char *str, bool quoted)
193193
else if (str[i] == '\n')
194194
fputs("\\\n", yyout);
195195
else if (str[i] == '\\')
196-
fputs("\\\\", yyout);
196+
{
197+
int j = 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
else if (str[i] == '\r' && str[i + 1] == '\n')
198209
{
199210
fputs("\\\r\n", yyout);

0 commit comments

Comments
 (0)