From 26fd96a96c6c84fbbcfe0919c34ac56511949cb3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Sun, 24 Mar 2024 20:12:53 +0000 Subject: [PATCH] doc: fix translation issue in chown/chgrp amalgamation * src/chown-core.h (emit_from_option_description): The conditional string composition here caused issues for translators. Instead move to a more general description ... (src/chown.c (usage): ... here. Fixes https://bugs.gnu.org/69985 --- po/POTFILES.in | 1 - src/chown-core.h | 12 ------------ src/chown.c | 8 +++++++- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 55aa9cc0a9..35c819ac2f 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -40,7 +40,6 @@ src/cat.c src/chcon.c src/chmod.c src/chown-core.c -src/chown-core.h src/chown.c src/chroot.c src/cksum.c diff --git a/src/chown-core.h b/src/chown-core.h index e1396e3eac..4bd68fed46 100644 --- a/src/chown-core.h +++ b/src/chown-core.h @@ -89,16 +89,4 @@ chown_files (char **files, int bit_flags, struct Chown_option const *chopt) _GL_ATTRIBUTE_NONNULL (); -static inline void -emit_from_option_description (bool user) -{ - printf (_("\ - --from=CURRENT_OWNER:CURRENT_GROUP\n\ - change the %sgroup of each file only if\n\ - its current owner and/or group match those specified\n\ - here. Either may be omitted, in which case a match\n\ - is not required for the omitted attribute\n\ -"), user ? "owner and/or " : ""); -} - #endif /* CHOWN_CORE_H */ diff --git a/src/chown.c b/src/chown.c index 90ce84d678..10c684b67a 100644 --- a/src/chown.c +++ b/src/chown.c @@ -109,7 +109,13 @@ With --reference, change the group of each FILE to that of RFILE.\n\ (useful only on systems that can change the\n\ ownership of a symlink)\n\ "), stdout); - emit_from_option_description (chown_mode == CHOWN_CHOWN); + fputs (_("\ + --from=CURRENT_OWNER:CURRENT_GROUP\n\ + change the ownership of each file only if\n\ + its current owner and/or group match those specified\n\ + here. Either may be omitted, in which case a match\n\ + is not required for the omitted attribute\n\ +"), stdout); fputs (_("\ --no-preserve-root do not treat '/' specially (the default)\n\ --preserve-root fail to operate recursively on '/'\n\ -- 2.47.2