From 9ceb5d8a7bfc4a6315f37913afb5f3d6cefa651f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 7 Feb 2000 23:10:11 +0000 Subject: Fixed psql double quoting of SQL ids Fixed libpq printing functions --- src/bin/psql/stringutils.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/bin/psql/stringutils.c') diff --git a/src/bin/psql/stringutils.c b/src/bin/psql/stringutils.c index 5ba48dc454c..a0d3769fd23 100644 --- a/src/bin/psql/stringutils.c +++ b/src/bin/psql/stringutils.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.23 2000/01/29 16:58:49 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.24 2000/02/07 23:10:06 petere Exp $ */ #include #include "stringutils.h" @@ -12,19 +12,13 @@ #include #include #include - #include -#include -#ifndef HAVE_STRDUP -#include -#endif #include -static void - unescape_quotes(char *source, char quote, char escape); +static void unescape_quotes(char *source, int quote, int escape); /* @@ -45,7 +39,7 @@ char * strtokx(const char *s, const char *delim, const char *quote, - char escape, + int escape, char *was_quoted, unsigned int *token_pos, int encoding) @@ -60,6 +54,10 @@ strtokx(const char *s, char *start; char *cp = NULL; +#ifndef MULTIBYTE + (void)encoding; /*not used*/ +#endif + if (s) { free(storage); @@ -160,7 +158,7 @@ strtokx(const char *s, * Resolves escaped quotes. Used by strtokx above. */ static void -unescape_quotes(char *source, char quote, char escape) +unescape_quotes(char *source, int quote, int escape) { char *p; char *destination, @@ -170,7 +168,7 @@ unescape_quotes(char *source, char quote, char escape) assert(source); #endif - destination = (char *) calloc(1, strlen(source) + 1); + destination = calloc(1, strlen(source) + 1); if (!destination) { perror("calloc"); -- cgit v1.2.3