groff-commit
[Top][All Lists]
Advanced

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

[groff] 08/27: src/preproc/eqn/main.cpp: Boolify.


From: G. Branden Robinson
Subject: [groff] 08/27: src/preproc/eqn/main.cpp: Boolify.
Date: Mon, 28 Aug 2023 15:54:45 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit d22a547b9bd2ed9f091c7feaac42696e68b7493f
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Aug 27 04:09:23 2023 -0500

    src/preproc/eqn/main.cpp: Boolify.
    
    * src/preproc/eqn/main.cpp (main): Trivially refactor; demote `int`
      `load_startup_file` to Boolean `want_startup_file`.
---
 ChangeLog                |  5 +++++
 src/preproc/eqn/main.cpp | 10 +++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 219576085..11c77ccb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-08-27  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/preproc/eqn/main.cpp (main): Trivially refactor; demote
+       `int` `load_startup_file` to Boolean `want_startup_file`.
+
 2023-08-25  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [eqn]: Implement "reset" keyword.
diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp
index aed51dd46..b625dd609 100644
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -322,7 +322,7 @@ int main(int argc, char **argv)
   static char stderr_buf[BUFSIZ];
   setbuf(stderr, stderr_buf);
   int opt;
-  int load_startup_file = 1;
+  bool want_startup_file = true;
   static const struct option long_options[] = {
     { "help", no_argument, 0, CHAR_MAX + 1 },
     { "version", no_argument, 0, 'v' },
@@ -336,7 +336,7 @@ int main(int argc, char **argv)
       compatible_flag = 1;
       break;
     case 'R':                  // don't load eqnrc
-      load_startup_file = 0;
+      want_startup_file = true;
       break;
     case 'M':
       config_macro_path.command_line_dir(optarg);
@@ -370,12 +370,12 @@ int main(int argc, char **argv)
       }
       else if (strcmp(device, "MathML") == 0) {
        output_format = mathml;
-       load_startup_file = 0;
+       want_startup_file = false;
       }
       else if (strcmp(device, "mathml:xhtml") == 0) {
        device = "MathML";
        output_format = mathml;
-       load_startup_file = 0;
+       want_startup_file = false;
        xhtml = 1;
       }
       break;
@@ -442,7 +442,7 @@ int main(int argc, char **argv)
           ".if !'%s'ps' .tm1 (consider invoking 'groff -Thtml -e')\n",
           device);
   }
-  if (load_startup_file) {
+  if (want_startup_file) {
     char *path;
     FILE *fp = config_macro_path.open_file(STARTUP_FILE, &path);
     if (fp) {



reply via email to

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