From patchwork Thu Jan 5 12:49:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 13089789 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 2E72BC3DA7D for ; Thu, 5 Jan 2023 12:49:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231912AbjAEMt5 (ORCPT ); Thu, 5 Jan 2023 07:49:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233231AbjAEMtu (ORCPT ); Thu, 5 Jan 2023 07:49:50 -0500 Received: from tarta.nabijaczleweli.xyz (unknown [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 007304C72E for ; Thu, 5 Jan 2023 04:49:48 -0800 (PST) Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 48CFDA38; Thu, 5 Jan 2023 13:49:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202211; t=1672922988; bh=YF+9i+Z73DlD+ffREeD2ra8boNSdcbOJpzp7LZOqUJs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y1SLvQBnKD/gpCGD8zkxXKujRwCr+zYBZkW39ITR0f04MS/jJQWyswPKxEcq51u/o ITVwPHgpEDr0rKX3Draz84n124ZrUHixiiWBP0SdLyMJxN6yWoY/7gqiNzv156OEaf XcYVMj6YIfy5yj9vvgcFQ8KpggDmZYFattnoZfRTKug5ywpRNMAIEYF70BGETxezrh QdjSD+vyvXUKxrC7/tVMuuq3m0WGow1tVzDSiUrksmdEHj+AoNtswZvTABCtuayro3 HPRdOPgAbK+99GBJshNsXD6jQ6PxxGiyX4SQsAGLrjq9VW6c0mgUw6z3XVh6QRcXqE 9FN0I/hlpeaeQ== Date: Thu, 5 Jan 2023 13:49:47 +0100 From: =?utf-8?b?0L3QsNCx?= To: Herbert Xu Cc: dash@vger.kernel.org Subject: [PATCH RESEND] alias: printalias: quote the name, too Message-ID: <20230105124947.ewohzmmwddcpj4en@tarta.nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20220429 Precedence: bulk List-ID: X-Mailing-List: dash@vger.kernel.org This ensures even something like alias 'a|b|c=d' is output by alias as 'a|b|c'='d' instead of a|b|c='d' which is both "suitable for reinput to the shell" per POSIX and doesn't execute the aliases as code. --- src/alias.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alias.c b/src/alias.c index daeacbb..1375cdd 100644 --- a/src/alias.c +++ b/src/alias.c @@ -197,7 +197,7 @@ freealias(struct alias *ap) { void printalias(const struct alias *ap) { - out1fmt("%s=%s\n", ap->name, single_quote(ap->val)); + out1fmt("%s=%s\n", single_quote(ap->name), single_quote(ap->val)); } STATIC struct alias **