From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41EB4C433F5 for ; Fri, 29 Oct 2021 08:51:44 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D9B7611AF for ; Fri, 29 Oct 2021 08:51:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7D9B7611AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4ED1E8331B; Fri, 29 Oct 2021 10:51:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="KEW8Q68k"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4CE7E83576; Fri, 29 Oct 2021 10:51:38 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6373683303 for ; Fri, 29 Oct 2021 10:51:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 3373261157; Fri, 29 Oct 2021 08:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635497491; bh=ufK9vPEJ0xXvLZeKI5ieENKbv/hpmeAOtPbheYtdH+0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KEW8Q68kyOQPj3ylZQOk7mgV12Uu3EYwclrBj7sxbQFULb9ig3ImSvoNjE7KGmSZz zniNMlm1mQq66NthfGDNFcVThIfIxqKPImprSG7RcZKAW1dJqhrHfa6u58OAwtsCrc OVIUi+QwBXR4ZZzOPMXGZNoZitArcokTaOcb9UAX/MG/NKAdTnWMkVC3Zmc9fa4/7w CDWb/XsbJtJA1uJGWm/vJ+NUYWzgOwc6oCzkah9Q9kjeAiirJ7fgYLlAVkgC7GhXr/ 0eT332WJsSruxAACepl3d0b5bwZgXLu00YLdx5uS8LhB/Qsj94eJK8Cr7r3IBoPNsL abPyC0Is/pxhw== Date: Fri, 29 Oct 2021 10:51:27 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Simon Glass Cc: Stefan Roese , Pali =?UTF-8?B?Um9ow6Fy?= , u-boot@lists.denx.de, Marek =?UTF-8?B?QmVow7pu?= Subject: Re: [PATCH 2/5] env: Fix env_get() when returning empty string using env_get_f() Message-ID: <20211029105127.68603aed@thinkpad> In-Reply-To: References: <20211028032810.18146-1-kabel@kernel.org> <20211028032810.18146-3-kabel@kernel.org> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Thu, 28 Oct 2021 21:17:38 -0600 Simon Glass wrote: > Hi Marek, >=20 > On Wed, 27 Oct 2021 at 21:28, Marek Beh=C3=BAn wrote: > > > > From: Marek Beh=C3=BAn > > > > The env_get_f() function returns -1 on failure. Returning 0 means that > > the variable exists, and is empty string. > > > > Signed-off-by: Marek Beh=C3=BAn > > --- > > env/common.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) =20 >=20 > Reviewed-by: Simon Glass >=20 > But it isn't normally possible to set an env var to an empty string. > How does this happen? Hmm, I don't see code in cmd/nvedit.c's _do_env_set() that would prohibit empty string as value... Why isn't it possible?