aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-03-31 19:22:41 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2011-03-31 19:22:41 +0000
commit51bb497c3e4dae08db5affc6fbf91b0a2eddae3f (patch)
tree242f14b4c64f7bffd4be5a88fb283d5175211796
parente979b2bccf103e93e138b86c967858e63b539f46 (diff)
downloadwyslij-po-51bb497c3e4dae08db5affc6fbf91b0a2eddae3f.tar.gz
wyslij-po-51bb497c3e4dae08db5affc6fbf91b0a2eddae3f.tar.bz2
Bugfix
* src/po.c (po_header): Fix the header scanning loop
-rw-r--r--src/po.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/po.c b/src/po.c
index af5d647..ec6ee20 100644
--- a/src/po.c
+++ b/src/po.c
@@ -221,15 +221,18 @@ po_header (const char *name)
break;
if (*p == '"' && p[len - 1] == '"')
{
- p[--len] = 0;
+ p[len-1] = 0;
+ len -= 2;
p++;
}
- if (size < bufsize)
+ if (len == 0)
+ continue;
+ if (size < len + 1)
{
- size = bufsize;
+ size = len + 1;
str = xrealloc (str, size);
}
- mu_wordsplit_c_unquote_copy (str, p, size);
+ mu_wordsplit_c_unquote_copy (str, p, len);
obstack_grow (&stk, str, strlen (str));
}
obstack_1grow (&stk, '\n');

Return to:

Send suggestions and report system problems to the System administrator.