bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] do not try to translate empty pre doc in argp_help


From: Andrei Borzenkov
Subject: [PATCH] do not try to translate empty pre doc in argp_help
Date: Sun, 30 Nov 2014 17:38:39 +0300

Every po file seems to include entry with empty msgid with some
meta information about it. If argp->doc string contains empty pre section
(like "\v" "Some text to output after options"), argp_help tries to
translate empty string and emits this meta information, like in

address@hidden:~/src/grub> grub2-mknetdir --help
Использование: grub2-mknetdir [ПАРАМЕТР…]
Project-Id-Version: grub 2.02-pre2
Report-Msgid-Bugs-To: address@hidden
POT-Creation-Date: 2013-12-24 21:18+0100
PO-Revision-Date: 2013-12-31 10:57+0400
...

Check that pre doc string is empty before translating it.

This is less of a problem with post doc which simply can omit "\v"
entirely, but there is no other way to skip pre doc, except explicitly
using help_filter (which is redundant in this case).

Signed-off-by: Andrei Borzenkov <address@hidden>

---
 lib/argp-help.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/argp-help.c b/lib/argp-help.c
index 9044e1b..e470cec 100644
--- a/lib/argp-help.c
+++ b/lib/argp-help.c
@@ -1510,7 +1510,7 @@ argp_doc (const struct argp *argp, const struct 
argp_state *state,
           else
             {
               inp_text_len = vt - argp->doc;
-              inp_text = __strndup (argp->doc, inp_text_len);
+              inp_text = inp_text_len ? __strndup (argp->doc, inp_text_len) : 
0;
             }
         }
       else
-- 
tg: (1b6c775..) u/argp-empty-msgstr (depends on: master)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]