bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* gen-uni-tables: Keep line number better up-to-date
@ 2024-02-23 17:26 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2024-02-23 17:26 UTC (permalink / raw)
  To: bug-gnulib

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  <bruno@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');





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-23 17:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-23 17:26 gen-uni-tables: Keep line number better up-to-date Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).