From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=83.166.143.171 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796162471; b=4XzVsrQm1qP0paiR3sH4l1lwTK/zVdD+PXOO09DPp9w8dDbm+Pn55gjR4Qz0Z4HjRgA/ HmGivv6/KCmIo3xY+0TdDNZybaxvYLWgZcW6VPQYQO0xmMNcYrifEdWUPUA1ZdYg0imOy 0YQs2c+YhuayL3Key7xvu0oxTk/Km/8OYs9fWipjrD0Dc5nhx6fn+B1aKaCHEgePXR1G6 CY0B0uDVMva1mea2fwe7IzCb3Y3+QPG5QSTa1fsY/92j+N23PNNgT6I7fPgifC/qgTiMg YGPsiNHyHwNknkJAD0UvVtCMWykYBnnTAs4N6cwt/YJN8V8xhLJp/IIJlxskQEETaSA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796162471; h=DMARC-Filter:Received:DKIM-Signature:Received:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding:X-Infomaniak-Routing; bh=OjQiudWU0y+mzcWMuj3q7y9kjvTwdH7gM4AOGvvKBQs=; b=j+h+bXhC1bJH0lVjdsfHXDblvdxO8603AZ7fovTpAwLii14PLcMrsnpYQyJEi+j4MruZ NX/wuo8+V2vYubTiZAZHlfgn0Ji6di8+k7zSGfZ9FW4TUER7BVkLOu3l2tp3Mh42te/Hv 90zRnqcDKfQOQxRC8XGXH9KDLwt+2oeUnLE8ra+diN3PuYxHr+IWaCUfInhBcTC/JF7mL Zjtrpj+vjgeZVkb5/D6XfO+FWA7HDh4g4j9ff+VxgBlgAFy8JbkHEAadN9Z5Acr4whT+r 7Pt65yXFYZXcce+8h2vzVVh/U30YpNbtwuaGb9xhalwTleQ9zX/3L3Hs4LPuKfksNvQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=daylightlinux.ch; spf=pass smtp.mailfrom=daylightlinux.ch; dkim=pass header.d=daylightlinux.ch header.i=@daylightlinux.ch header.a=rsa-sha256 header.s=20261016 header.b=SfyjZ3ZT; arc=none smtp.remote-ip=83.166.143.171 Received: from smtp-8fab.mail.infomaniak.ch (smtp-8fab.mail.infomaniak.ch [83.166.143.171]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06C38606A31A; Tue, 1 Dec 2026 22:01:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 06C38606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=daylightlinux.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=daylightlinux.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=daylightlinux.ch header.i=@daylightlinux.ch header.a=rsa-sha256 header.s=20261016 header.b=SfyjZ3ZT Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-4-3000 (Postfix) with ESMTPS id 4jfFFv6zxBz161d; Tue, 1 Dec 2026 23:01:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daylightlinux.ch; s=20261016; t=1796162467; bh=OjQiudWU0y+mzcWMuj3q7y9kjvTwdH7gM4AOGvvKBQs=; h=From:To:Cc:Subject:Date:From; b=SfyjZ3ZTN2tQbVB3dkcNGX+xwCILhCRiqP+gUtQRNl3eTMt9OTCvkZm28Ud3UKK1c dYc5g6tLS9P6L8l2kuNGh6NnAdxc3TiaYldfARFv3IXo7Rm6VMYRVUJxfOunfjmAKC 09qj/3JEVWneC6j9J9CliC4utYmfUwGwwz123Vm1KST49lLilbEWNbWVza1+yCnTbC pGGqWF1LchOr8WAEHiAmqIxDBOzsymrV/cS475LTVP0P9YmXqd4zRs9K4eD8JYhAlA 5AhxdDIXHCAU7WDYlRgevKB6WLnkyfwwteJhzlCv6iZNdcLLPkpkXmK5auwt/PLajX AbA/gOoSNdC8Q== Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4jfFFt65C9zjyq; Tue, 1 Dec 2026 23:01:06 +0100 (CET) Received: from unknown by raspberrypi.home with local (Exim 4.96) (envelope-from ) id 1xYVuM-004jzI-1Z; Tue, 01 Dec 2026 23:01:06 +0100 From: Hamdy Abou El Anein To: nathan@kernel.org, nsc@kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, sam@ravnborg.org, tim.bird@am.sony.com Subject: [PATCH] kconfig: diffconfig: preserve a final line without a newline Date: Tue, 1 Dec 2026 23:01:03 +0100 Message-ID: <20261201220103.12350-1-info@daylightlinux.ch> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha readconfig() unconditionally removes the last character of each line. If a configuration fragment has no terminating newline, diffconfig truncates its last value or fails to recognize an unset option. For example, comparing CONFIG_FOO=y followed by a newline with the same line without a newline reports a change from y to an empty value. Strip only the newline instead of removing the final character. Tested with identical and changed values, unset options without a final newline, and regular newline-terminated files. AI assistance: ChatGPT identified the bug by inspecting the script and prepared the fix, commit message and local regression tests. Fixes: a717417e7f96 ("kconfig: add diffconfig utility") Signed-off-by: Hamdy Abou El Anein --- scripts/diffconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/diffconfig b/scripts/diffconfig index 43f0f3d273ae..9e84288e0d1f 100755 --- a/scripts/diffconfig +++ b/scripts/diffconfig @@ -40,7 +40,7 @@ Example usage: def readconfig(config_file): d = {} for line in config_file: - line = line[:-1] + line = line.rstrip("\n") if line[:7] == "CONFIG_": name, val = line[7:].split("=", 1) d[name] = val -- 2.56.1