Commit 5ae42452 authored by Bruce Momjian's avatar Bruce Momjian

Fix multiline C comments in psql.

parent e5f5e73f
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright 2000 by PostgreSQL Global Development Group * Copyright 2000 by PostgreSQL Global Development Group
* *
* $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.53 2003/03/20 06:43:35 momjian Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.54 2003/03/20 22:08:50 momjian Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "mainloop.h" #include "mainloop.h"
...@@ -278,8 +278,10 @@ MainLoop(FILE *source) ...@@ -278,8 +278,10 @@ MainLoop(FILE *source)
ADVANCE_1; ADVANCE_1;
} }
/* end of extended comment? */ /* in or end of extended comment? */
else if (line[i] == '*' && line[i + thislen] == '/') else if (in_xcomment)
{
if (line[i] == '*' && line[i + thislen] == '/')
{ {
in_xcomment--; in_xcomment--;
if (in_xcomment <= 0) if (in_xcomment <= 0)
...@@ -288,6 +290,7 @@ MainLoop(FILE *source) ...@@ -288,6 +290,7 @@ MainLoop(FILE *source)
ADVANCE_1; ADVANCE_1;
} }
} }
}
/* start of quote? */ /* start of quote? */
else if (line[i] == '\'' || line[i] == '"') else if (line[i] == '\'' || line[i] == '"')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment