]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: Perl: Fix a bug when reading here documents in a non-UTF-8 encoding.
authorBruno Haible <bruno@clisp.org>
Wed, 25 Sep 2024 20:18:31 +0000 (22:18 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 26 Sep 2024 11:12:13 +0000 (13:12 +0200)
* gettext-tools/src/xgettext.c (get_here_document): Update read_bytes when
switching from the original encoding to the UTF-8 encoding.

gettext-tools/src/x-perl.c

index 68dc3a3b17cfab3bcfb59231bb39217504b91c37..178b54b628c054ce82d25755715d344c714f3464 100644 (file)
@@ -480,6 +480,7 @@ get_here_document (struct perl_extractor *xp, const char *delimiter)
               my_linebuf = xrealloc (my_linebuf, my_linebuf_size);
             }
           strcpy (my_linebuf, my_line_utf8);
+          read_bytes = strlen (my_line_utf8);
           free (my_line_utf8);
         }