gbranden pushed a commit to branch master
in repository groff.
commit 623a96176fad5b2de9a7ab15e98649dc755f9beb
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Nov 15 17:59:26 2026 -0600
[libgroff]: Slightly refactor; use default arg.
* src/include/searchpath.h (class search_path): Default third third
constructor argument to `false`.
* src/libs/libgroff/fontfile.cpp:
* src/libs/libgroff/macropath.cpp:
* src/preproc/html/pre-html.cpp: Simplify constructor callers that
specified `false` explicitly.
Continues the long process of fixing Savannah #66672.
---
ChangeLog | 13 +++++++++++++
src/include/searchpath.h | 2 +-
src/libs/libgroff/fontfile.cpp | 2 +-
src/libs/libgroff/macropath.cpp | 5 +++--
src/preproc/html/pre-html.cpp | 2 +-
5 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3c36ed66e..fd551b925 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2026-11-15 G. Branden Robinson <[email protected]>
+
+ [libgroff]: Slightly refactor; use default argument.
+
+ * src/include/searchpath.h (class search_path): Default third
+ third constructor argument to `false`.
+ * src/libs/libgroff/fontfile.cpp:
+ * src/libs/libgroff/macropath.cpp:
+ * src/preproc/html/pre-html.cpp: Simplify constructor callers
+ that specified `false` explicitly.
+
+ Continues the long process of fixing Savannah #66672.
+
2026-11-15 G. Branden Robinson <[email protected]>
[libgroff]: Slightly refactor; boolify.
diff --git a/src/include/searchpath.h b/src/include/searchpath.h
index 3e1695cf4..9dce83bca 100644
--- a/src/include/searchpath.h
+++ b/src/include/searchpath.h
@@ -22,7 +22,7 @@ class search_path {
unsigned init_len; // TODO: size_t
public:
search_path(const char * /* envvar */, const char * /* standard */,
- bool);
+ bool = false);
~search_path();
const char* contents() const;
void command_line_dir(const char *);
diff --git a/src/libs/libgroff/fontfile.cpp b/src/libs/libgroff/fontfile.cpp
index f1beea0d0..21323f370 100644
--- a/src/libs/libgroff/fontfile.cpp
+++ b/src/libs/libgroff/fontfile.cpp
@@ -35,7 +35,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
// See groff(1), section "Environment".
const char *const FONT_ENV_VAR = "GROFF_FONT_PATH";
-static search_path font_path(FONT_ENV_VAR, FONTPATH, false);
+static search_path font_path(FONT_ENV_VAR, FONTPATH);
int font::res = 0;
int font::hor = 1;
diff --git a/src/libs/libgroff/macropath.cpp b/src/libs/libgroff/macropath.cpp
index b0834b486..4f13201e6 100644
--- a/src/libs/libgroff/macropath.cpp
+++ b/src/libs/libgroff/macropath.cpp
@@ -29,9 +29,10 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#define MACROPATH_ENVVAR "GROFF_TMAC_PATH"
+// Init only "unsafe" macro path with the current working directory.
search_path macro_path(MACROPATH_ENVVAR, MACROPATH, true);
-search_path safer_macro_path(MACROPATH_ENVVAR, MACROPATH, false);
-search_path config_macro_path(MACROPATH_ENVVAR, MACROPATH, false);
+search_path safer_macro_path(MACROPATH_ENVVAR, MACROPATH);
+search_path config_macro_path(MACROPATH_ENVVAR, MACROPATH);
// Local Variables:
// fill-column: 72
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index 6c496636e..1ecdfc1dd 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -238,7 +238,7 @@ static const char devhtml_desc[] = "devhtml/DESC";
static const char devps_desc[] = "devps/DESC";
const char *const FONT_ENV_VAR = "GROFF_FONT_PATH";
-static search_path font_path(FONT_ENV_VAR, FONTPATH, false);
+static search_path font_path(FONT_ENV_VAR, FONTPATH);
static html_dialect dialect = html4;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit