Article View: linux.kernel.git
Article #798Re: [PATCH] archive-zip: refactor 'path too long' error message to use Q_()
From: Phillip Wood
Date: Mon, 19 Oct 2026 13:58
Date: Mon, 19 Oct 2026 13:58
51 lines
9778 bytes
9778 bytes
Hi Keryle
On 19/10/2026 09:44, kerylefondji7@gmail.com wrote:
> From: Keryle Fondji <kerylefondji7@gmail.com>
>
> The error message used "chars" even when pathlen was 1.
Looking at the code below, pathlen has to be longer than 0xffff to
trigger this message. However there can be more than one form of the
plural string though. The gettext manual has the following example of
the Polish translation of "file" for different numbers of files [1]
1 plik
2,3,4 pliki
5-21 plików
22-24 pliki
25-31 plików
so using Q_() is correct, but we should explain that it is to
accommodate different plural forms, rather than because pathlen can be 1.
Thanks
Phillip
[1]
https://www.gnu.org/software/gettext/manual/gettext.html#Additional-functions-for-plural-forms
>
> Replace _() with Q_() to handle both singular and plural forms
> correctly depending on the value of pathlen.
>
> Signed-off-by: Keryle Fondji <kerylefondji7@gmail.com>
> ---
> archive-zip.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/archive-zip.c b/archive-zip.c
> index 6f73ca6d58..e4f8ef5a36 100644
> --- a/archive-zip.c
> +++ b/archive-zip.c
> @@ -328,7 +328,7 @@ static int write_zip_entry(struct archiver_args *args,
> }
>
> if (pathlen > 0xffff) {
> - return error(_("path too long (%d chars, SHA1: %s): %s"),
> + return error(Q_("path too long (%d char, SHA1: %s): %s", "path too long (%d chars, SHA1: %s): %s", pathlen),
> (int)pathlen, oid_to_hex(oid), path);
> }
>
Technical Details
Message-ID:
<96187a3b-411c-42bd-8979-fb45006daa34@gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72403-linux-kernel-git=dewy.ruReferences:
<20261019084427.1879-1-kerylefondji7@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72403-linux-kernel-git=dewy.ru
From: phillip.wood123@gmail.com (Phillip Wood)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH] archive-zip: refactor 'path too long' error message to
use Q_()
Date: Mon, 19 Oct 2026 14:58:10 +0100
Organization: Usenet Network
Message-ID: <96187a3b-411c-42bd-8979-fb45006daa34@gmail.com>
References: <20261019084427.1879-1-kerylefondji7@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="3636954"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:YI0m1+r+F2XwKxqZzdvfB9543S0= sha256:0FAmVl2UHOpInpop13emXFWKhiqednyxUK9Lyow6Y7Y=
sha1:0yW3HuZiQG7RR5Say5LieiG2mNk= sha256:mkxRNvWgiBCjn/xkVSmpY7LNL/QBXcLEoHPioFUFg2I=
Content-Language: en-US
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id E7A76110A38; Mon, 19 Oct 2026 18:03:11 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.948
X-Spam-Status: No, score=-1.948 tagged_above=-9999 required=6.31
tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id KVNqwd6p0evH;
Mon, 19 Oct 2026 18:03:08 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-72403-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 73920110A03; Mon, 19 Oct 2026 18:02:59 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sea.lore.kernel.org (Postfix) with ESMTP id 8FE791010D8; Mon, 19 Oct 2026 14:20:40 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 44EB0572EB1;
Mon, 19 Oct 2026 13:58:19 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VdPOJls0"
X-Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F8585008C2
for <git@vger.kernel.org>; Mon, 19 Oct 2026 13:58:14 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1792418297; cv=none; b=EkEhtuYStSPW1jqer1oELTphSJtU6QVhX+UlfboKJNtwfjgGcgl1f7Mfwlss1pJ9yKMBNnc8isrOA9r59a6ZqScPehNZRIo9VL0NpDLhswI/keBUTeQ8UZJv0u8bSSoguvOw0isbK2/LpJ7o5aMTGj+OBocJMUhU7CkYYYPzvvs=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1792418297; c=relaxed/simple;
bh=ZXhDba0J2DEYWGl30O7YU1UmgR5JR6Lbk8V3aX66qIw=;
h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
In-Reply-To:Content-Type; b=ZZXe90I9T39RjPeglmYpC3J4D3/smrVu6Dx/CcqjhFeNVqi04Hb0odghXu9HkoLpinlJDL6Vsvhg0kmcfSj6bBbAO8jR41y+njjbV/7UaUHWHE/K/60OnouSnDMqKyDzJQ/jw75bVZX3ZntdBPU6VmkTHB2p6j2cDqxOblF+I48=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VdPOJls0; arc=none smtp.client-ip=209.85.221.50
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-48dee593f18so1580471f8f.3
for <git@vger.kernel.org>; Mon, 19 Oct 2026 06:58:14 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1792418292; x=1793023092; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:in-reply-to:from
:content-language:references:cc:to:subject:reply-to:user-agent
:mime-version:date:message-id:from:to:cc:subject:date:message-id
:reply-to:content-type;
bh=M21jaqlOYpnVmhCz0Ep3UFuWxcBbuCacpoVNWcecCNY=;
b=VdPOJls09W+pqIyQaB2onY0rMgsGNXoRgXZrh39SZtolWO+8egOag6F2x8OWdaCpSH
VyXefE1nV0inRnoteV4bCGhSENtz9ja1GSOEn425JOw0TIwu5bRcH5XzhoQfl8nrSGo0
xiSyTbYLs8BDNpBc5ACLBVR8n2pgehBH+YEQPqQgGLU/Qjr3xs2PRT70X+A8AlkfmotM
DhW+7w16GPBjgxgH4Wc3B3tXmxiZXebTMp0344PsgpJqnyJsrh3xtmtBrC57gBOXKFHn
CDDK+NJxOSIknJa1v7Bp/7YqvhL+J+d5trZPz9twKSdhycrELIB85dmkSnMCA6RJ1Oz5
5P4A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792418292; x=1793023092;
h=content-transfer-encoding:content-type:in-reply-to:from
:content-language:references:cc:to:subject:reply-to:user-agent
:mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to:content-type;
bh=M21jaqlOYpnVmhCz0Ep3UFuWxcBbuCacpoVNWcecCNY=;
b=sO6N/sDxwHi0yQAgKQvspe2wjUsqHEfCQfprdlzh0GkoVbIR+h7Z76mCVqdgeKTaxo
Hn+rkXVjvrrHJhBKrod+kOHCFwpEkYdgWHTHz+MOojUB89oujceytNG/pPQdtdr5DQWN
52gvEwcsPzwLiPj+AIjG6MGyXL4I5TmWEU3UY589IIlFvS1Nm+yGYizGgO5JgluA2CIO
mvJfI6Zhjr7U9w2pLjiW1k+MGVcpijlauhJ7V/QGybPb6jOpUOjcFIMZapMjSfn8aHqa
r3PPGtfcHZVhkZFDfc5c4MAhvWOBA+oQazdDn5INCAngoAwStsRmF+6NA/XsrD4Oe5sO
DKeA==
X-Forwarded-Encrypted: i=1; AKwUvBzOmX+fgPs5iiUbFT7XYkKvxN1XoR8A7OTNpwdwCh0IDdDtNrsCjWEfQIVtjSkSeElLN5Y=@vger.kernel.org
X-Gm-Message-State: AFq9FYKXzhQNygEWE0QbpiiFwSJHIOfKWv4rYngUUrq6GWsWihBRD1d0
vqin7knpNXpxKNteUSaEcAHa6nKdJ1kS+lfpBMkzydyQTNxtBCl5d9u1
X-Gm-Gg: AYBFou2smXTQ/Basb0mD4Q1P9IGiNvLNT9jRfhMiwqMHOV3PEdSCM5v+DLXa//TrdBr
DG/QyDIM/5ZH8zjb2JXyOFNMbXjG9WMxMeLbXcBheWqQCCZRxJvIF5QzN6wPtG9bYf+mMsH8kv5
q1HjWo4RzTZ+TYb+4v/TG1h7zwyD01fhRsoIgZZOudgIL1pHMIkK/9jL7rNdXiYnrDc58cZ3NuQ
AdhmQLoPsrxHwRIwNE5Zn8FsqovzGYy1JqsZnFKswamC4bNj/rx3mwXGYIi78SUEvMYB/sW1fFj
qbUZwa0Xo2dBRYwa444uL1NyvCP/xv9fMxkxUmT9FHrrOJVV93u8A0n9kyXtqKWMze3W225RoAU
b6ox3+Rpqd7huSwb1JVSV5zPYTJSTY7nc+ilVk5i692xsAfVsOiPkWgOvG9siNIibHfSkunQG21
q9+0niS7MTwgDlg2DPNMszd06FoaaSVT6tP9YW37KNbDWvFQihNmX/WVRh9+Y2YeRH7bsC1haI1
3WsmkK5S0kNtCSuuG4U2ZvRgcf8BUx1hdRRfTG2hDdApjmV/Mfb
X-Received: by 2002:a05:6000:260d:b0:48c:7f18:c85e with SMTP id ffacd0b85a97d-48e07fabbb0mr16224795f8f.45.1792418292341;
Mon, 19 Oct 2026 06:58:12 -0700 (PDT)
X-Received: from ?IPV6:2a0a:ef40:724:6601:f3ff:aebc:61f8:d91f? ([2a0a:ef40:724:6601:f3ff:aebc:61f8:d91f])
by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48dfd4c0894sm21337907f8f.12.2026.10.19.06.58.11
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Mon, 19 Oct 2026 06:58:11 -0700 (PDT)
X-Precedence: bulk
X-Mailing-List: git@vger.kernel.org
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-User-Agent: Mozilla Thunderbird
X-Reply-To: phillip.wood@dunelm.org.uk
X-Cc: gitster@pobox.com, christiancouder@gmail.com, siddharthasthana31@gmail.com
X-In-Reply-To: <20261019084427.1879-1-kerylefondji7@gmail.com>