gbranden pushed a commit to branch master
in repository groff.
commit 13ef6bf14fc888cc7fd245873496da07a5b2b9aa
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Nov 15 20:49:21 2026 -0600
[libgroff]: Refactor.
* src/libs/libgroff/searchpath.cpp (search_path::search_path): Drop more
dead code. With `add_home` gone, we no longer need to declare or use
the `home` local variable.
---
ChangeLog | 6 ++++++
src/libs/libgroff/searchpath.cpp | 7 -------
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9f82d7e55..e0c1e0e6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-11-15 G. Branden Robinson <[email protected]>
+
+ * src/libs/libgroff/searchpath.cpp (search_path::search_path):
+ Drop more dead code. With `add_home` gone, we no longer need
+ to declare or use the `home` local variable.
+
2026-11-02 G. Branden Robinson <[email protected]>
* src/preproc/soelim/soelim.cpp (do_so): Fix line number
diff --git a/src/libs/libgroff/searchpath.cpp b/src/libs/libgroff/searchpath.cpp
index 4b24bbf7a..3d8aee858 100644
--- a/src/libs/libgroff/searchpath.cpp
+++ b/src/libs/libgroff/searchpath.cpp
@@ -55,14 +55,11 @@ static bool is_directory(const char *name)
search_path::search_path(const char *envvar, const char *standard,
bool add_current_working_directory)
{
- char *home = 0 /* nullptr */;
char *e = 0 /* nullptr */;
if (envvar != 0 /* nullptr */)
e = getenv(envvar);
dirs = new char[((e && *e) ? strlen(e) + 1 : 0)
+ (add_current_working_directory ? 1 + 1 : 0)
- + (((home != 0 /* nullptr */) && (*home != '\0'))
- ? strlen(home) + 1 : 0)
+ ((standard && *standard) ? strlen(standard) : 0)
+ 1];
*dirs = '\0';
@@ -74,10 +71,6 @@ search_path::search_path(const char *envvar, const char
*standard,
strcat(dirs, ".");
strcat(dirs, PATH_SEP);
}
- if (home && *home) {
- strcat(dirs, home);
- strcat(dirs, PATH_SEP);
- }
if (standard && *standard)
strcat(dirs, standard);
init_len = strlen(dirs);
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit