File tree 1 file changed +18
-19
lines changed
1 file changed +18
-19
lines changed Original file line number Diff line number Diff line change 3
3
*
4
4
* Copyright 2000 by PostgreSQL Global Development Group
5
5
*
6
- * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.30 2000/05/12 16:13:44 petere Exp $
6
+ * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.31 2000/06/29 16:27:57 momjian Exp $
7
7
*/
8
8
#include "postgres.h"
9
9
#include "mainloop.h"
18
18
19
19
#ifndef WIN32
20
20
#include <setjmp.h>
21
-
22
21
sigjmp_buf main_loop_jmp ;
23
-
24
22
#endif
25
23
26
24
@@ -298,18 +296,13 @@ MainLoop(FILE *source)
298
296
bslash_count = 0 ;
299
297
300
298
rescan :
301
- /* in quote ? */
302
- if (in_quote )
299
+ /* start of extended comment ? */
300
+ if (line [ i ] == '/' && line [ i + thislen ] == '*' )
303
301
{
304
- /* end of quote */
305
- if (line [i ] == in_quote && bslash_count % 2 == 0 )
306
- in_quote = '\0' ;
302
+ xcomment = true;
303
+ ADVANCE_1 ;
307
304
}
308
305
309
- /* start of quote */
310
- else if (!was_bslash && (line [i ] == '\'' || line [i ] == '"' ))
311
- in_quote = line [i ];
312
-
313
306
/* in extended comment? */
314
307
else if (xcomment )
315
308
{
@@ -320,20 +313,26 @@ MainLoop(FILE *source)
320
313
}
321
314
}
322
315
323
- /* start of extended comment? */
324
- else if (line [i ] == '/' && line [i + thislen ] == '*' )
325
- {
326
- xcomment = true;
327
- ADVANCE_1 ;
328
- }
329
-
330
316
/* single-line comment? truncate line */
331
317
else if (line [i ] == '-' && line [i + thislen ] == '-' )
332
318
{
333
319
line [i ] = '\0' ; /* remove comment */
334
320
break ;
335
321
}
336
322
323
+ /* in quote? */
324
+ else if (in_quote )
325
+ {
326
+ /* end of quote */
327
+ if (line [i ] == in_quote && bslash_count % 2 == 0 )
328
+ in_quote = '\0' ;
329
+ }
330
+
331
+ /* start of quote */
332
+ else if (!was_bslash &&
333
+ (line [i ] == '\'' || line [i ] == '"' ))
334
+ in_quote = line [i ];
335
+
337
336
/* count nested parentheses */
338
337
else if (line [i ] == '(' )
339
338
paren_level ++ ;
You can’t perform that action at this time.
0 commit comments