gbranden pushed a commit to branch master
in repository groff.

commit e538ec27650d09caeef2dd9ba03ce1cc48fdbd60
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Mar 29 20:21:31 2026 -0500

    [libgroff]: Reduce linkage of `msw2posixpath()`.
    
    * src/libs/libgroff/relocate.cpp (msw2posixpath): Declare as `static`
      since it does not require external linkage.
---
 ChangeLog                      |  5 +++++
 src/libs/libgroff/relocate.cpp | 10 +++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 3a3a995b6..bdf4afe69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2026-03-29  G. Branden Robinson <[email protected]>
+
+       * src/libs/libgroff/relocate.cpp (msw2posixpath): Declare as
+       `static` since it does not require external linkage.
+
 2026-03-29  G. Branden Robinson <[email protected]>
 
        * src/libs/libgroff/relocate.cpp (searchpathext): Declare as
diff --git a/src/libs/libgroff/relocate.cpp b/src/libs/libgroff/relocate.cpp
index 8c35d77b9..3faa33b89 100644
--- a/src/libs/libgroff/relocate.cpp
+++ b/src/libs/libgroff/relocate.cpp
@@ -155,7 +155,7 @@ static char *searchpathext(const char *name, const char 
*pathext,
 #endif
 
 // Convert an MS path to a POSIX path.
-char *msw2posixpath(char *path)
+static char *msw2posixpath(char *path)
 {
   char *s = path;
   while (*s) {
@@ -188,11 +188,19 @@ void set_current_prefix()
     curr_prefix = searchpathext(program_name, pathextstr, getenv("PATH"));
     delete[] pathextstr;
   }
+  // XXX: Should the `msw2posixpath(curr_prefix)` below move here?
 #else /* !_WIN32 */
   curr_prefix = searchpath(program_name, getenv("PATH"));
   if (!curr_prefix)
     return;
 #endif /* !_WIN32 */
+ // XXX: Move this?  See above.  It seems that by calling it here we
+ // prevent groff from correctly handling file names with literal
+ // backslashes in them on POSIX systems.  That's not a salutary naming
+ // practice, and evidently not a popular one either, as it's drawn no
+ // complaints, but it still seems a needless restriction.  (At the same
+ // time I'm a fan of banning all C0 controls from file names without
+ // exception.) --GBR
   msw2posixpath(curr_prefix);
 #if DEBUG
   fprintf(stderr, "curr_prefix: %s\n", curr_prefix);

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to