From c49d926833fa6a987e3f9a66027f4a01d7a008be Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 16 Dec 2021 12:01:59 -0500 Subject: Clean up some more freshly-dead code in pg_dump and pg_upgrade. I missed a few things in 30e7c175b and e469f0aaf, as noted by Justin Pryzby. Discussion: https://postgr.es/m/2923349.1634942313@sss.pgh.pa.us --- src/bin/pg_dump/dumputils.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/bin/pg_dump/dumputils.c') diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c index dfc96bc98ba..b5900e4ed84 100644 --- a/src/bin/pg_dump/dumputils.c +++ b/src/bin/pg_dump/dumputils.c @@ -39,8 +39,7 @@ static void AddAcl(PQExpBuffer aclbuf, const char *keyword, * TABLE, SEQUENCE, FUNCTION, PROCEDURE, LANGUAGE, SCHEMA, DATABASE, TABLESPACE, * FOREIGN DATA WRAPPER, SERVER, or LARGE OBJECT) * acls: the ACL string fetched from the database - * baseacls: the initial ACL string for this object; can be - * NULL or empty string to indicate "not available from server" + * baseacls: the initial ACL string for this object * owner: username of object owner (will be passed through fmtId); can be * NULL or empty string to indicate "no owner known" * prefix: string to prefix to each generated command; typically empty @@ -104,17 +103,14 @@ buildACLCommands(const char *name, const char *subname, const char *nspname, return false; } - /* Parse the baseacls, if provided */ - if (baseacls && *baseacls != '\0') + /* Parse the baseacls too */ + if (!parsePGArray(baseacls, &baseitems, &nbaseitems)) { - if (!parsePGArray(baseacls, &baseitems, &nbaseitems)) - { - if (aclitems) - free(aclitems); - if (baseitems) - free(baseitems); - return false; - } + if (aclitems) + free(aclitems); + if (baseitems) + free(baseitems); + return false; } /* -- cgit v1.2.3