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

bor@opensuse:~/src/grub> grub2-mknetdir --help
Использование: grub2-mknetdir [ПАРАМЕТР…]
Project-Id-Version: grub 2.02-pre2
Report-Msgid-Bugs-To: bug-g...@gnu.org
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 <arvidj...@gmail.com>

---
 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