diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2000-02-07 23:10:11 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2000-02-07 23:10:11 +0000 |
commit | 9ceb5d8a7bfc4a6315f37913afb5f3d6cefa651f (patch) | |
tree | cfe54170ff754e064955bb00be586a5b26ab7db3 /src/bin/psql/stringutils.c | |
parent | 4842ef86247a323de9ec25e799d756c320222fe0 (diff) | |
download | postgresql-9ceb5d8a7bfc4a6315f37913afb5f3d6cefa651f.tar.gz postgresql-9ceb5d8a7bfc4a6315f37913afb5f3d6cefa651f.zip |
Fixed psql double quoting of SQL ids
Fixed libpq printing functions
Diffstat (limited to 'src/bin/psql/stringutils.c')
-rw-r--r-- | src/bin/psql/stringutils.c | 20 |
1 files changed, 9 insertions, 11 deletions
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 <c.h> #include "stringutils.h" @@ -12,19 +12,13 @@ #include <stdlib.h> #include <string.h> #include <assert.h> - #include <stdio.h> -#include <postgres.h> -#ifndef HAVE_STRDUP -#include <strdup.h> -#endif #include <libpq-fe.h> -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"); |