diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-12-14 22:22:29 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-12-14 22:22:29 +0000 |
commit | 9fe195b9871d38df12aa9c2dcc3d5736f5294e4b (patch) | |
tree | 2cbeb9566fe3d0d6c47d3fd2dc5aa40e41aab3a8 | |
parent | 930dd5ad7723cab4add8e651c47e267f23397467 (diff) | |
download | wyslij-po-9fe195b9871d38df12aa9c2dcc3d5736f5294e4b.tar.gz wyslij-po-9fe195b9871d38df12aa9c2dcc3d5736f5294e4b.tar.bz2 |
Update
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/po.c | 23 |
2 files changed, 21 insertions, 8 deletions
@@ -1,3 +1,9 @@ +2015-12-15 Sergey Poznyakoff <gray@gnu.org.ua> + + Fix compatibility with the recent MU commits. + + * src/po.c (po_header): Use mu_wordsplit to process headers. + 2014-09-02 Sergey Poznyakoff <gray@gnu.org.ua> Update for newer gnulib @@ -185,10 +185,14 @@ po_header (const char *name) struct po_file pof; size_t bufsize = 0; char *buf = NULL; - char *str = NULL; - size_t size = 0; struct obstack stk; int status; + struct mu_wordsplit ws; + int wsflags = MU_WRDSF_NOVAR | MU_WRDSF_NOCMD + | MU_WRDSF_QUOTE + | MU_WRDSF_CESCAPES + | MU_WRDSF_NOSPLIT; + char *str; po_open (&pof, name); if (!po_find_msgid (&pof)) @@ -227,19 +231,22 @@ po_header (const char *name) } if (len == 0) continue; - if (size < len + 1) + if (mu_wordsplit (p, &ws, wsflags)) { - size = len + 1; - str = xrealloc (str, size); + mu_error (_("cannot split \"%s\": %s"), + p, mu_wordsplit_strerror (&ws)); + exit (1); } - mu_wordsplit_c_unquote_copy (str, p, len); - obstack_grow (&stk, str, strlen (str)); + wsflags |= MU_WRDSF_REUSE; + obstack_grow (&stk, ws.ws_wordv[0], strlen (ws.ws_wordv[0])); } obstack_1grow (&stk, '\n'); obstack_1grow (&stk, 0); po_close (&pof); - free (str); + if (wsflags & MU_WRDSF_REUSE) + mu_wordsplit_free (&ws); + free (buf); str = obstack_finish (&stk); |