mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Fixed psql double quoting of SQL ids
Fixed libpq printing functions
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user