From patchwork Mon Jan 9 00:15:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?0L3QsNCx?= X-Patchwork-Id: 13092759 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B33C7C54EBC for ; Mon, 9 Jan 2023 00:15:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230441AbjAIAPr (ORCPT ); Sun, 8 Jan 2023 19:15:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230315AbjAIAPq (ORCPT ); Sun, 8 Jan 2023 19:15:46 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 94C2AEE for ; Sun, 8 Jan 2023 16:15:45 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id DFDDF1048; Mon, 9 Jan 2023 01:15:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1673223344; bh=WFHUqTpNWxTbB2UEuJwbBuUVa7wOWmEAT+Qln0r+DT8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=teeuVMG8/o+SOvqPs98bpvYsXJ/suDQSyx/fkO9zdTFQDiE+zqreXFsCpE5LTdInp ybj7qwacwVd0IEv1kUCF81F3llDD7Lw/wH0S66uaeKk2LxiFez26kIjYWmhfGWiOWH AVy8DwrcCrAkEq78Z6/03nYbQolWG8Y7giJjjO68NJpOjYLvnj9NXfp5/n+fn8iZt2 KR6FPsAwpoxHAWNcdFPlZlKC2f3uNwIpMRJXwLwEUepj5Qkm4mlk8lgSDKGicM/4p5 PjVzT1zvxu0S+JUoCl95XbE9l3ypHDsQAbXhgOZMd48HOCqy86FGWXcvsIMUwrg0vU pu+5P+Hr/3A/w== Date: Mon, 9 Jan 2023 01:15:43 +0100 From: =?utf-8?b?0L3QsNCx?= To: Harald van Dijk Cc: Herbert Xu , dash@vger.kernel.org Subject: [PATCH v2] alias: fix name quoting in printalias Message-ID: <20230109001543.vpk6khjtqkjtrjox@tarta.nabijaczleweli.xyz> References: <20230109001219.2ylktzb7uckoeti5@tarta.nabijaczleweli.xyz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230109001219.2ylktzb7uckoeti5@tarta.nabijaczleweli.xyz> User-Agent: NeoMutt/20220429 Precedence: bulk List-ID: X-Mailing-List: dash@vger.kernel.org single_quote() over-writes the stack string, so just output the name separately first. Fixes: commit 4ec545e8dc98a3f461cf56bed03adafa81c64aec ("alias: Quote name in printalias") --- really not my year sorry src/alias.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/alias.c b/src/alias.c index 1375cdd..fcad43b 100644 --- a/src/alias.c +++ b/src/alias.c @@ -197,7 +197,8 @@ freealias(struct alias *ap) { void printalias(const struct alias *ap) { - out1fmt("%s=%s\n", single_quote(ap->name), single_quote(ap->val)); + out1str(single_quote(ap->name)); + out1fmt("=%s\n", single_quote(ap->val)); } STATIC struct alias **