Tiny patch on print.c of psql - Mailing list pgsql-patches

From Jean-Paul Argudo
Subject Tiny patch on print.c of psql
Date
Msg-id 41F0BF35.6000902@argudo.org
Whole thread Raw
Responses Re: Tiny patch on print.c of psql
Re: Tiny patch on print.c of psql
List pgsql-patches
Hi all,

This is my 1st patch ever in C :-)... I was just borried by a bad psql
\H html output of an EXPLAIN

because it didnt respected spaces sent from backend like:

-> Sort
    -> Sort

I just remarked in this print.c the case of a white space wasnt handled
in the function escaping special caracters to HTML codes, so I added it
replacing a space by special html " " (& n b s p).

So we'll have now:

-> Sort
  -> Sort

... in the html generated

(see example at http://www.pack-solutions.net/~jpargudo/explain.html)

Then, every single space in the html source is replaced by this. The
source looks ugly, yes, I will look to *only replacing starting spaces*
of each row of the EXPLAIN, thats will be my 1st patch ever, version 2 :)

So I post this patch only FYI..  I had much fun playing with C a bit :-)
(yes, I dont code C, just a bit of Perl and Python).

Cheers! Thanks again for such a powerfull release.

--
Jean-Paul Argudo
www.PostgreSQLFr.org
--- postgresql-8.0.0/src/bin/psql/print.c    2005-01-01 06:43:08.000000000 +0100
+++ postgresql-8.0.0-patch/src/bin/psql/print.c    2005-01-20 21:54:56.000000000 +0100
@@ -617,6 +617,9 @@
             case '\'':
                 fputs("'", fout);
                 break;
+            case ' ':
+                fputs(" ", fout);
+                break;
             default:
                 fputc(*p, fout);
         }

pgsql-patches by date:

Previous
From: Stephen Frost
Date:
Subject: Merge pg_shadow && pg_group -- UNTESTED
Next
From: "Dave Page"
Date:
Subject: Re: [pgsql-hackers-win32] pg_autovacuum fails to start - 8.0 Release