groff-commit
[Top][All Lists]
Advanced

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

[groff] 05/17: [troff]: Make `pcolor` request flush stderr.


From: G. Branden Robinson
Subject: [groff] 05/17: [troff]: Make `pcolor` request flush stderr.
Date: Thu, 18 Jan 2024 14:27:49 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit ba09150cb4c55553a72b7dc2987af4ec99634f24
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Jan 17 13:31:25 2024 -0600

    [troff]: Make `pcolor` request flush stderr.
    
    * src/roff/troff/input.cpp (report_color): Flush standard error stream
      after dumping defined colors.  Trivially refactor to generalize and
      eliminate use of pointless temporary.  Continues commit e080a78c91, 5
      January.
---
 ChangeLog                |  7 +++++++
 src/roff/troff/input.cpp | 14 +++++++-------
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a7cb82d4b..709b8ea38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-01-17  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp (report_color): Flush standard error
+       stream after dumping defined colors.  Trivially refactor to
+       generalize and eliminate use of pointless temporary.  Continues
+       commit e080a78c91, 5 January.
+
 2024-01-16  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/troff/input.cpp (encode_char_for_troff_output):
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index c64d6540e..093770bd2 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -1544,14 +1544,14 @@ static void report_color()
   // TODO: Accept an argument to look up a color by name and dump its
   // info (name, color space, channel values).
   dictionary_iterator iter(color_dictionary);
-  symbol entry;
-  color *color_entry;
-  while(iter.get(&entry, reinterpret_cast<void **>(&color_entry))) {
-    assert(!entry.is_null());
-    assert(color_entry != 0 /* nullptr */);
-    const char *color_name = entry.contents();
-    errprint("%1\n", color_name);
+  symbol key;
+  color *value;
+  while(iter.get(&key, reinterpret_cast<void **>(&value))) {
+    assert(!key.is_null());
+    assert(value != 0 /* nullptr */);
+    errprint("%1\n", key.contents());
   }
+  fflush(stderr);
   skip_line();
 }
 



reply via email to

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