Commit 7085aba5 authored by Bruce Momjian's avatar Bruce Momjian

Remove quote removal. Moved to parser.

parent 36aaf250
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scansup.c,v 1.4 1996/11/04 04:04:58 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/scansup.c,v 1.5 1996/11/15 18:38:55 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -23,15 +23,6 @@ ...@@ -23,15 +23,6 @@
#include "utils/elog.h" #include "utils/elog.h"
#include "parser/scansup.h" #include "parser/scansup.h"
/*
* Scanner error handler.
*/
static void
serror(char *str)
{
elog(WARN, "*** scanner error: %s\n", str);
}
/* ---------------- /* ----------------
* scanstr * scanstr
* *
...@@ -51,31 +42,14 @@ char* ...@@ -51,31 +42,14 @@ char*
scanstr(char *s) scanstr(char *s)
{ {
static char newStr[MAX_PARSE_BUFFER]; static char newStr[MAX_PARSE_BUFFER];
int len, i, start, j; int len, i, j;
char delimiter;
if (s == NULL || s[0] == '\0') if (s == NULL || s[0] == '\0')
return s; return s;
len = strlen(s); len = strlen(s);
start = 0;
/* remove leading and trailing quotes, if any */
/* the normal backend lexer only accepts single quotes, but the
bootstrap lexer accepts double quotes */
delimiter = 0;
if (s[0] == '"' || s[0] == '\''){
delimiter = s[0];
start = 1;
}
if (delimiter != 0) {
if (s[len-1] == delimiter)
len = len - 1;
else
serror("mismatched quote delimiters");
}
for (i = start, j = 0; i < len ; i++) { for (i = 0, j = 0; i < len ; i++) {
if (s[i] == '\'') { if (s[i] == '\'') {
i = i + 1; i = i + 1;
if (s[i] == '\'') if (s[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