File tree 1 file changed +3
-29
lines changed
1 file changed +3
-29
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/parser/scansup.c,v 1.4 1996/11/04 04:04:58 momjian Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/parser/scansup.c,v 1.5 1996/11/15 18:38:55 momjian Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
23
23
#include "utils/elog.h"
24
24
#include "parser/scansup.h"
25
25
26
- /*
27
- * Scanner error handler.
28
- */
29
- static void
30
- serror (char * str )
31
- {
32
- elog (WARN , "*** scanner error: %s\n" , str );
33
- }
34
-
35
26
/* ----------------
36
27
* scanstr
37
28
*
@@ -51,31 +42,14 @@ char*
51
42
scanstr (char * s )
52
43
{
53
44
static char newStr [MAX_PARSE_BUFFER ];
54
- int len , i , start , j ;
55
- char delimiter ;
45
+ int len , i , j ;
56
46
57
47
if (s == NULL || s [0 ] == '\0' )
58
48
return s ;
59
49
60
50
len = strlen (s );
61
- start = 0 ;
62
-
63
- /* remove leading and trailing quotes, if any */
64
- /* the normal backend lexer only accepts single quotes, but the
65
- bootstrap lexer accepts double quotes */
66
- delimiter = 0 ;
67
- if (s [0 ] == '"' || s [0 ] == '\'' ){
68
- delimiter = s [0 ];
69
- start = 1 ;
70
- }
71
- if (delimiter != 0 ) {
72
- if (s [len - 1 ] == delimiter )
73
- len = len - 1 ;
74
- else
75
- serror ("mismatched quote delimiters" );
76
- }
77
51
78
- for (i = start , j = 0 ; i < len ; i ++ ) {
52
+ for (i = 0 , j = 0 ; i < len ; i ++ ) {
79
53
if (s [i ] == '\'' ) {
80
54
i = i + 1 ;
81
55
if (s [i ] == '\'' )
You can’t perform that action at this time.
0 commit comments