Re: psql patch - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: psql patch
Date
Msg-id 200303202213.h2KMD5Y04200@candle.pha.pa.us
Whole thread Raw
In response to psql patch  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
Responses Re: psql patch  ("Jeroen T. Vermeulen" <jtv@xs4all.nl>)
List pgsql-patches
I have applied the following patch to fix a bug in the new psql patch.
It wasn't handling multi-line /* */ comments properly.  Jeroen, would
you review the change.  The rest of the changes look very good.

---------------------------------------------------------------------------

pgman wrote:
>
> Patch applied and attached.  Thanks.
>
> I had to modify the handling of cancelConn.  It wasn't properly being
> defined and set in the original patch.
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/bin/psql/mainloop.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/bin/psql/mainloop.c,v
retrieving revision 1.53
diff -c -c -r1.53 mainloop.c
*** src/bin/psql/mainloop.c    20 Mar 2003 06:43:35 -0000    1.53
--- src/bin/psql/mainloop.c    20 Mar 2003 22:08:07 -0000
***************
*** 272,292 ****

              /* start of extended comment? */
              else if (line[i] == '/' && line[i + thislen] == '*')
!                     {
                  in_xcomment++;
                  if (in_xcomment == 1)
!                         ADVANCE_1;
!                     }

!             /* end of extended comment? */
!             else if (line[i] == '*' && line[i + thislen] == '/')
              {
!                 in_xcomment--;
!                 if (in_xcomment <= 0)
                  {
!                     in_xcomment = 0;
!                 ADVANCE_1;
!             }
              }

              /* start of quote? */
--- 272,295 ----

              /* start of extended comment? */
              else if (line[i] == '/' && line[i + thislen] == '*')
!             {
                  in_xcomment++;
                  if (in_xcomment == 1)
!                     ADVANCE_1;
!             }

!             /* in or end of extended comment? */
!             else if (in_xcomment)
              {
!                 if (line[i] == '*' && line[i + thislen] == '/')
                  {
!                     in_xcomment--;
!                     if (in_xcomment <= 0)
!                     {
!                         in_xcomment = 0;
!                         ADVANCE_1;
!                     }
!                 }
              }

              /* start of quote? */

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: minor SELECT doc patch
Next
From: Tom Lane
Date:
Subject: Sequence patch has problems