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

Commit921de09

Browse files
committed
Use ' ' escapes for leading spaces in table values, for use in
EXPLAIN output.Jean-Paul Argudo
1 parent8563cca commit921de09

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

‎src/bin/psql/print.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.59 2005/06/1402:57:41 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.60 2005/06/1422:15:57 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"common.h"
@@ -595,8 +595,10 @@ void
595595
html_escaped_print(constchar*in,FILE*fout)
596596
{
597597
constchar*p;
598-
598+
boolleading_space= true;
599+
599600
for (p=in;*p;p++)
601+
{
600602
switch (*p)
601603
{
602604
case'&':
@@ -617,9 +619,19 @@ html_escaped_print(const char *in, FILE *fout)
617619
case'\'':
618620
fputs("'",fout);
619621
break;
622+
case' ':
623+
/* protect leading space, for EXPLAIN output */
624+
if (leading_space)
625+
fputs(" ",fout);
626+
else
627+
fputs(" ",fout);
628+
break;
620629
default:
621630
fputc(*p,fout);
622631
}
632+
if (*p!=' ')
633+
leading_space= false;
634+
}
623635
}
624636

625637

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp