aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2021-02-06 07:52:04 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2021-02-06 07:52:04 +0000
commit6f725b8a3f294cf875b9777593dc2544161a9f32 (patch)
tree236ad070f876133411588a9ef3d93c92f20a27b2
parent26a42a0e917f08ed536435d1a139ab5556d0bf4c (diff)
downloadwyslij-po-6f725b8a3f294cf875b9777593dc2544161a9f32.tar.gz
wyslij-po-6f725b8a3f294cf875b9777593dc2544161a9f32.tar.bz2
Fix po header parsing
* src/po.c (po_header): Don't handle single quotes. Leave double-quote handling to mu_wordsplit. * ChangeLog: Update.
-rw-r--r--ChangeLog7
-rw-r--r--src/po.c10
2 files changed, 9 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index f39cc24..660952d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-02-06 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ Fix po header parsing
+
+ * src/po.c (po_header): Don't handle single quotes. Leave
+ double-quote handling to mu_wordsplit.
+
2018-02-02 Sergey Poznyakoff <gray@gnu.org.ua>
Version 3.2
diff --git a/src/po.c b/src/po.c
index 4072abd..7be1556 100644
--- a/src/po.c
+++ b/src/po.c
@@ -189,7 +189,7 @@ po_header (const char *name)
int status;
struct mu_wordsplit ws;
int wsflags = MU_WRDSF_NOVAR | MU_WRDSF_NOCMD
- | MU_WRDSF_QUOTE
+ | MU_WRDSF_DQUOTE
| MU_WRDSF_CESCAPES
| MU_WRDSF_NOSPLIT;
char *str;
@@ -218,17 +218,11 @@ po_header (const char *name)
len = po_read_line (&pof, &buf, &bufsize);
if (buf[len - 1] == '\n')
buf[--len] = 0;
-
+
for (p = buf; *p && mu_isblank (*p); p++, len--)
;
if (*p == 0)
break;
- if (*p == '"' && p[len - 1] == '"')
- {
- p[len-1] = 0;
- len -= 2;
- p++;
- }
if (len == 0)
continue;
if (mu_wordsplit (p, &ws, wsflags))

Return to:

Send suggestions and report system problems to the System administrator.