gen-uni-tables could, while reading EastAsianWidth.txt or LineBreak.txt, output
a diagnostic with a wrong line number. The cause is that 'lineno' was not
correctly kept up-to-date while reading a blank line.

This patch fixes it.


2024-02-23  Bruno Haible  <br...@clisp.org>

        gen-uni-tables: Keep line number better up-to-date.
        * lib/gen-uni-tables.c (fill_width, fill_org_lbp): Increase lineno by 1
        when reading a blank line.

diff --git a/lib/gen-uni-tables.c b/lib/gen-uni-tables.c
index ea5e6aa3f8..90d33abab1 100644
--- a/lib/gen-uni-tables.c
+++ b/lib/gen-uni-tables.c
@@ -6616,6 +6616,8 @@ fill_width (const char *width_filename)
       c = getc (stream);
       if (c == EOF)
         break;
+      if (c == '\n')
+        continue;
       if (c == '#')
         {
           do c = getc (stream); while (c != EOF && c != '\n');
@@ -8571,6 +8573,8 @@ fill_org_lbp (const char *linebreak_filename)
       c = getc (stream);
       if (c == EOF)
         break;
+      if (c == '\n')
+        continue;
       if (c == '#')
         {
           do c = getc (stream); while (c != EOF && c != '\n');




Reply via email to