diff options
Diffstat (limited to 'src/bin/pg_dump/common.c')
-rw-r--r-- | src/bin/pg_dump/common.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c index c9a806f10a6..7974a9db6dd 100644 --- a/src/bin/pg_dump/common.c +++ b/src/bin/pg_dump/common.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.25 1998/09/20 03:18:42 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.26 1998/10/02 16:43:38 thomas Exp $ * * Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2 * @@ -486,6 +486,9 @@ findFuncByName(FuncInfo *finfo, int numFuncs, const char *name) * * checks input string for non-lowercase characters * returns pointer to input string or string surrounded by double quotes + * + * Note that the returned string should be used immediately since it + * uses a static buffer to hold the string. Non-reentrant but fast. */ const char * fmtId(const char *rawid) @@ -493,11 +496,12 @@ fmtId(const char *rawid) const char *cp; static char id[MAXQUERYLEN]; - for (cp = rawid; *cp != '\0'; cp++) - if (!(islower(*cp) || isdigit(*cp) || (*cp == '_'))) - break; + if (! g_force_quotes) + for (cp = rawid; *cp != '\0'; cp++) + if (!(islower(*cp) || isdigit(*cp) || (*cp == '_'))) + break; - if (*cp != '\0') + if (g_force_quotes || (*cp != '\0')) { strcpy(id, "\""); strcat(id, rawid); |