Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpXEK-0005ov-8N for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Feb 2019 11:43:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gpXEG-0000Rv-M4 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Feb 2019 11:43:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpXEG-0000Ro-Ez for pgsql-hackers@lists.postgresql.org; Fri, 01 Feb 2019 11:43:28 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpXED-0005YL-KQ for pgsql-hackers@postgresql.org; Fri, 01 Feb 2019 11:43:27 +0000 Received: by mail-ed1-x541.google.com with SMTP id b14so5188102edt.6 for ; Fri, 01 Feb 2019 03:43:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=MNNSf5IH8fpGE4nx216Ere4TTZK4V+xSQ4+2cSzRPAk=; b=MGcMHt2STG91cqmxfSsAZRhZ9O9b/4WLJkhjbNO8ztN14iv9o0/ZTmnW8G93W52EGr IR6jUA04pgisfM+Yuc99S5G8d/lfETPnoFtRshGfwC0cZJsyJnvQXAI7E8+EsFz9LkbP 8CLbj1WUkIPTpUQgVToYMkEZlfj685x6vU9l54UWiKjScgnUBLVHV9TWuMIVIqRN/dKD ZgUlZTdSsgbsQB66tryue1oTsu3GEmBaI0BwkUAXmlkEVRmb51i/vJ6Fog7M+tF7K4ch XYtjiT/+WU310nS3C3P68ih4sOM8UczW0Z2EM7S/5ngF1G86tMtUYQGKN3/c5xQKuxQd h39w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=MNNSf5IH8fpGE4nx216Ere4TTZK4V+xSQ4+2cSzRPAk=; b=ZCCSdnMaHAopAoDbj+zRlnEO66CTWObyykI0MhLPZh6vQD0WYkYZ9T+BwyKO1IrprM 12k/GnHLMrmXPj+iHhqJ2ngsozzgBLffZrkZEngesv/Ti641lIaLL4BJ5LN5xpzWTU8b iS0aX5OhAK+qOU+vDFoPa7IiYr5HdnEIjP88iyZNG/VHZ2rh5Ux8sv7j4NLdWxMJvsAw r9fq5sR0Q6QMgpJNeGdSdCMckdRFX9YjQ9iD36/ni3i5qhcpeCwiMFsVAZZLqvsP+2g5 22d5zIHudL4Ve0R6nHBYaQr0h2ebgJHZuNdpkVjbC4TqLQQk66Yx1GLES/19Cssq1uyb zBKg== X-Gm-Message-State: AJcUuke6DeMjaLszUYrK9BzBc5eTugkJcLeAmf8X1qUeFSw56TL+E/wa +j3m7taBhLri2mtVNbYYE37SVAgo1iq0Yw== X-Google-Smtp-Source: ALg8bN699Hv1H/f6R7LZEH7Lbo0HQwSPjws98FGb3AKpoghoj0F5Tm3qLAAIXs9EkB+KtoOU5EDjqQ== X-Received: by 2002:a50:8262:: with SMTP id 89mr37025495edf.125.1549021404369; Fri, 01 Feb 2019 03:43:24 -0800 (PST) Received: from alvin.alvh.no-ip.org (83.224-78-194.adsl-static.isp.belgacom.be. [194.78.224.83]) by smtp.gmail.com with ESMTPSA id j31sm1989760eda.46.2019.02.01.03.43.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Feb 2019 03:43:23 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 247129B2; Fri, 1 Feb 2019 08:43:23 -0300 (-03) Date: Fri, 1 Feb 2019 08:43:23 -0300 From: Alvaro Herrera To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: Andres Freund , Tom Lane , Chapman Flack , Amit Khandekar , PostgreSQL-development Subject: Re: ArchiveEntry optional arguments refactoring Message-ID: <201902011143.zzf7gxlxeszc@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201902011133.t5pccj6jraqe@alvherre.pgsql> User-Agent: NeoMutt/20180716-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Feb-01, Alvaro Herrera wrote: > ... so this code > > if (!ropt->noOwner) > sanitized_owner = replace_line_endings(te->owner); > else > sanitized_owner = pg_strdup("-"); > > can become > sanitized_owner = replace_line_endings(te->owner, true); Sorry, there's a silly bug here because I picked the wrong example to hand-type. The proposed pattern works fine for the schema cases, not for this owner case. The owner case is correctly handled (AFAICT) in the patch I posted. (Also for some reason I decided to go with "hyphen" instead of "dash" in the argument name. Not sure if anybody cares strongly about using the right terminology there (I don't know which it is). -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services