groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 09/11: [grohtml]: Fix code style nit.


From: G. Branden Robinson
Subject: [groff] 09/11: [grohtml]: Fix code style nit.
Date: Fri, 13 Aug 2021 10:05:49 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 8c9c997cc6a2530e99dcab71a27bb9eb26c6226b
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Aug 13 20:33:10 2021 +1000

    [grohtml]: Fix code style nit.
    
    * src/preproc/html/pre-html.cpp (get_resolution): Unbrace a
      single-statement `while` loop per prevailing coding style.  Add
      comments noting how we aren't parsing DESC files _precisely_ as our
      documentation specifies.
---
 ChangeLog                     | 7 +++++++
 src/preproc/html/pre-html.cpp | 9 +++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 049a8a9..b1bbb40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2021-08-13  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * src/preproc/html/pre-html.cpp (get_resolution): Unbrace a
+       single-statement `while` loop per prevailing coding style.  Add
+       comments noting how we aren't parsing DESC files _precisely_ as
+       our documentation specifies.
+
+2021-08-13  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        Convert font class `int` members to `bool` where appropriate.
 
        * src/include/font.h (font class): Demote integers to Booleans
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index bb95bb1..f5b15a2 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -302,9 +302,11 @@ static unsigned int get_resolution(void)
   if (0 == f)
     fatal("cannot open file '%1'", devps_desc);
   free(pathp);
-  while (get_line(f)) {
+  // XXX: We should break out of this loop if we hit a "charset" line.
+  // "This line and everything following it in the file are ignored."
+  // (groff_font(5))
+  while (get_line(f))
     (void) sscanf(linebuf, "res %u", &res);
-  }
   fclose(f);
   return res;
 }
@@ -326,6 +328,9 @@ static char *get_image_generator(void)
   if (0 == f)
     fatal("cannot open file '%1'", devhtml_desc);
   free(pathp);
+  // XXX: We should break out of this loop if we hit a "charset" line.
+  // "This line and everything following it in the file are ignored."
+  // (groff_font(5))
   while (get_line(f)) {
     char *cursor = linebuf;
     size_t limit = strlen(linebuf);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]