groff-commit
[Top][All Lists]
Advanced

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

[groff] 10/10: [grohtml]: Fix Savannah #60971.


From: G. Branden Robinson
Subject: [groff] 10/10: [grohtml]: Fix Savannah #60971.
Date: Mon, 26 Jul 2021 20:38:50 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit c71b4ef4aa46f9264751df37ffac4fdf796c45eb
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Jul 27 00:10:49 2021 +1000

    [grohtml]: Fix Savannah #60971.
    
    * src/preproc/html/pre-html.cpp (makeFileName): Consistently put a dash
      at the end of `macroset_template` whether the image file name stem is
      user-supplied or the default.  Stop adding the dash before the image
      number in `image_template` instead.  This makes the image file name
      format reliable whether the image needs to be subdivided (eqn) or not
      (tbl).
    
    Fixes <https://savannah.gnu.org/bugs/?60971>.
---
 ChangeLog                         | 13 +++++++++++++
 src/devices/grohtml/grohtml.1.man |  7 ++++++-
 src/preproc/html/pre-html.cpp     |  9 +++++----
 3 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0d405ea..44880d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2021-07-26  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       [grohtml]: Fix Savannah #60971.
+
+       * src/preproc/html/pre-html.cpp (makeFileName): Consistently put
+       a dash at the end of `macroset_template` whether the image file
+       name stem is user-supplied or the default.  Stop adding the dash
+       before the image number in `image_template` instead.  This makes
+       the image file name format reliable whether the image needs to
+       be subdivided (eqn) or not (tbl).
+
+       Fixes <https://savannah.gnu.org/bugs/?60971>.
+
+2021-07-26  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        [grohtml]: Reduce noise to standard error stream.
 
        * src/preproc/html/pre-html.cpp (imageList::createImage): Fix
diff --git a/src/devices/grohtml/grohtml.1.man 
b/src/devices/grohtml/grohtml.1.man
index 6ee201f..4a18e3a 100644
--- a/src/devices/grohtml/grohtml.1.man
+++ b/src/devices/grohtml/grohtml.1.man
@@ -328,12 +328,17 @@ indicates 200 pixels per inch.
 .BI \-I \~image-stem
 Determine the image file name stem.
 .
-If omitted grohtml uses
+If omitted,
+.I grohtml
+uses
 .IR \%grohtml\- XXXXX
 (where
 .I XXXXX
 is the process ID).
 .
+A dash is appended to the stem to separate it from the following image
+number.
+.
 .
 .TP
 .BI \-j \~output-stem
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index 7fb7c64..88fcca1 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -530,20 +530,21 @@ static void makeFileName(void)
   }
 
   if (image_template == NULL)
-    macroset_template = make_message("%sgrohtml-%d", image_dir,
+    macroset_template = make_message("%sgrohtml-%d-", image_dir,
                                     (int)getpid());
   else
-    macroset_template = make_message("%s%s", image_dir, image_template);
+    macroset_template = make_message("%s%s-", image_dir,
+                                    image_template);
 
   if (macroset_template == NULL)
     sys_fatal("make_message");
 
   image_template =
-    (char *)malloc(strlen("-%d") + strlen(macroset_template) + 1);
+    (char *)malloc(strlen("%d") + strlen(macroset_template) + 1);
   if (image_template == NULL)
     sys_fatal("malloc");
   strcpy(image_template, macroset_template);
-  strcat(image_template, "-%d");
+  strcat(image_template, "%d");
 }
 
 /*



reply via email to

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