From patchwork Sun Feb 9 15:07:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1235451 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::439; helo=mail-wr1-x439.google.com; envelope-from=swupdate+bncbcxploxj6ikrbvoaqdzakgqew56rl6i@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=Wt6gXWqb; dkim-atps=neutral Received: from mail-wr1-x439.google.com (mail-wr1-x439.google.com [IPv6:2a00:1450:4864:20::439]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48FsqG53v7z9sPJ for ; Mon, 10 Feb 2020 02:08:10 +1100 (AEDT) Received: by mail-wr1-x439.google.com with SMTP id t6sf3321840wru.3 for ; Sun, 09 Feb 2020 07:08:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1581260886; cv=pass; d=google.com; s=arc-20160816; b=zXNcNYp6gC8z/QrMjT4fS6SEYAgrgU1XRf+hEBpz7WX1jo+l0k5EYEXq8tQ6IH7VrJ SA78YcvVtuJxmRxsnkxBJJA1NIU9quf2gWPsfNHKZw/1wl8TsSQDhpuS9x+J5AVl8TlW RR09/2ZTioWWr06JR0ex4MbuWDhyR8QJ/Pk83XLGLQIwGkB8ZySlYu4v0Qe+1IFjdlng uySE0cZX9m3/t1RhL8eQSqjqXEJyi531rtxw/38jION1U60V54StpSlzcv6HLgDIT/WB RhhYFZv6xXW3zx+nuVZqGS11X69yCmDJLukw9S3GrKqHHgAIwkwllwDFmLrhxTpdB8UJ 3oZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=xG4TSzjF9QoThxWK+GvvIi96Td746SKZzRVaOcqachA=; b=BL1aIi6jhC01AZR6cfZmHNYTvJn9BDXx3/8hD2yWpZkot4vON9JfT2z3Rok/AoqZfK 17qmumuNojXj8zWlWjXN4UoQIL7iLSLa9TBRolJblh3wtZKlq6tx/R+s1Shdu3B1mA49 Czv3Sc7mgtEM0+RYvu+sISoGhvYLKQdR6P4kPHK0I6SFA6MauChlTjEBJKdtzZEdP9hz MFB6Alv1a8tfKP4RlPwmVW3lhkaeBD5iwzxoY6eQIIUzebe6nbEQSTi707OnPcM9aDEL JPaATjTjtbKTUwT2LGd+8jrjXUaLOw8MsFPiYlXcHH7hzumCy016ryPqfnbVTvwvVl37 42Xg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=xG4TSzjF9QoThxWK+GvvIi96Td746SKZzRVaOcqachA=; b=Wt6gXWqbn0LeHDlPNFXooVuuPLC2OMo7tEACxGuh8yMuorhHu7GRN12pqF3LYWj4yW 0BvHy3cR3NSCPuLsSpjtreGx2Pa+CeLYcaJYMHzXhVlvQeYJ8aw2mB5nvm+Aos4NZg7x i84TZ//z8S80NPQRQCtSjISWqtPWjUHeSyYZRwUgbNIM3OHEsqJfmqsyeVGl0kyLhtgK 2Q5WiTn9MLpD2MsZfQuSq6FF3blj9Xs7wQ2mrpLGtWnH5D03awYk+46Fa/xsVKb8jfZs zMjTyLQVqoZg2EEh88rn/WhBoG9db3VdWlhciN3JztoRt117GnBsD3VJrSN9aD8fnF/5 UJgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=xG4TSzjF9QoThxWK+GvvIi96Td746SKZzRVaOcqachA=; b=uSKHI669KJcHs/+wbt3BXmYsC6AtU7qbq0mOuyHz9ANVTRZEIv2ZMHNZp/IdH6Bwe2 brKkBhjdHXWzRRjoGRae2F6n2S6o6L2bV7ykldOsSaX/qCBq6gysQz9D5iMNAagYHq2o 6ZTdTPGgMR0UgwV0TVBL4gA3KYlU9y6R5ZD+tpIEVhNUici00VWjS9QSr9HlBfEJu3SN godzXqwUlDeeVNZUKrOJ70j1d32Jq8NDDa1mH06JZ0IQdOqibUg2+5COlVYaKCgHLTzA ALLHI6i4vWiroLxLhPi32W3VWTlLGIPXrLA6a8WyjF8Qx7FG/sgT/OIw//4IU7ctfmvg NlFg== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAVBYhjHJ2AXlSL8BNpQ04CpZGWQlyfmliafNs0SDEzFB39iOdkP rmVZNF628BVFnscaBKEB3aQ= X-Google-Smtp-Source: APXvYqw832C0lvUp132mQiAdWRkj7px+isbPUmD0aBXIU52sWTFtM2bcuck4X5Cq8px4wnXRKJlraQ== X-Received: by 2002:a05:600c:292:: with SMTP id 18mr10528493wmk.128.1581260886186; Sun, 09 Feb 2020 07:08:06 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a7b:c0d9:: with SMTP id s25ls12090307wmh.0.gmail; Sun, 09 Feb 2020 07:08:05 -0800 (PST) X-Received: by 2002:a7b:c5d9:: with SMTP id n25mr10089574wmk.65.1581260885417; Sun, 09 Feb 2020 07:08:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581260885; cv=none; d=google.com; s=arc-20160816; b=oaYCIq530Bzs5F75CDnSRS8taLJ6Tac9N8e/ih3QAKjpNw+UAiRjdLOxfalK1qjufg HpI6PYSxaVGEsMPiC8A+AWTU6GBn1xEF5Yixn/UPerYIDumAhfqP5C+cuS3wNFn/G3a7 MopBigq49h3TLEwRoJdV7r98b7D6FdoFar450MrguDxgvgi/t3kouYWvtIgOEdXnA4A4 HiaEHapwfm0od4lDlmjvtDadi5AyQwsoSQY7wzSRgF078A4RafaOH5qQRlmTHukrvKDa J+BnsJcNa0iDEhJbCNzz8eZHdJRtr3tepDbNq/DARtjN5wEQigwjGs8/LRYURJi5EYOm iLoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=ifEOoL+PaELRocTQElxlgWjj5KxizrRTCloSXBB5QN8=; b=oBQ/rWfx4PQJ+LFrIX08QWIqNlvpVzfuqEqHL9JoGCwrqCj66ga89Dn+QacYdINKkp 3+U5Vi1TgVv+65AHGF5EZL8dymFkaBNTXL7MBvezOEXTfXl901kCfHe6lyybq61T+GxR LjH2OUc0tvBOCrgmM0ZsgN0Th8BjsXMIrQO9xGzhizYaEKtnM2DNpKIulqcPWV2aump7 9Buyxi6iNYvbhvD5U3hInq0UmCqPjuo866ru5SyAM2dUzKX+WYzuHj63pQmyTVoNuD2I JjAPrkdYm63gjP1oIxUXrbTmFCaDBdp54xf7s/TSTQkr1FDO5ipFEM5R8+KpsOFYkc6U voxQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id e21si1069123wme.1.2020.02.09.07.08.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Feb 2020 07:08:05 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 48Fsq91fXDz1qqkx; Sun, 9 Feb 2020 16:08:05 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 48Fsq91QTrz1qrmT; Sun, 9 Feb 2020 16:08:05 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id hBhApIR6j1iv; Sun, 9 Feb 2020 16:08:04 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Sun, 9 Feb 2020 16:08:04 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id DA5F44540486; Sun, 9 Feb 2020 16:08:04 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hAnhf9CNNrpS; Sun, 9 Feb 2020 16:08:02 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [IPv6:fd00::d0c:b6cf:de15:8699]) by babic.homelinux.org (Postfix) with ESMTP id 56F17454005D; Sun, 9 Feb 2020 16:08:02 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [libubootenv][PATCH] Variables are not removed when loading from file Date: Sun, 9 Feb 2020 16:07:59 +0100 Message-Id: <20200209150759.8481-1-sbabic@denx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Instead of removing a variable, variable is assigned to a zero-length string. Signed-off-by: Stefano Babic --- src/uboot_env.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/uboot_env.c b/src/uboot_env.c index 475ce0c..8926373 100644 --- a/src/uboot_env.c +++ b/src/uboot_env.c @@ -1068,6 +1068,9 @@ int libuboot_load_file(struct uboot_ctx *ctx, const char *filename) name = buf; + if (!strlen(value)) + value = NULL; + libuboot_set_env(ctx, name, value); } fclose(fp);