gbranden pushed a commit to branch master
in repository groff.

commit 0f6f550da9dd27cd03224e25b11143f6b61c378d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Mar 30 19:08:43 2026 -0500

    [libgroff]: Drop unnecessary function call.
    
    * src/libs/libgroff/relocate.cpp (set_current_prefix): Move call of
      `msw2posixpath()` from an all-configurations path through the function
      to an `#ifdef _win32`-only one.
    
      (msw2posixpath) [_WIN32]: Since this function is now only called if
      `_WIN32` is defined, shift an `#endif` to also define it only under
      that circumstance.
---
 ChangeLog                      |  9 +++++++++
 src/libs/libgroff/relocate.cpp | 12 ++----------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 03144f09d..ad4275aa3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2026-03-30  G. Branden Robinson <[email protected]>
+
+       * src/libs/libgroff/relocate.cpp (set_current_prefix): Move call
+       of `msw2posixpath()` from an all-configurations path through the
+       function to an `#ifdef _WIN32`-only one.
+       (msw2posixpath) [_WIN32]: Since this function is now only called
+       if `_WIN32` is defined, shift an `#endif` to also define it only
+       under that circumstance.
+
 2026-03-29  G. Branden Robinson <[email protected]>
 
        * src/include/lf.h: Drop argument names from function
diff --git a/src/libs/libgroff/relocate.cpp b/src/libs/libgroff/relocate.cpp
index 70e32c382..58da6b1dd 100644
--- a/src/libs/libgroff/relocate.cpp
+++ b/src/libs/libgroff/relocate.cpp
@@ -152,7 +152,6 @@ static char *searchpathext(const char *name, const char 
*pathext,
   delete[] tmpathext;
   return found;
 }
-#endif
 
 // XXX: This function is nearly identical to
 // `normalize_file_name_for_lf_request()` in "libgroff/lf.cpp".
@@ -168,6 +167,7 @@ static char *msw2posixpath(char *path)
   }
   return path;
 }
+#endif
 
 // Compute the current prefix.
 void set_current_prefix()
@@ -191,20 +191,12 @@ void set_current_prefix()
     curr_prefix = searchpathext(program_name, pathextstr, getenv("PATH"));
     delete[] pathextstr;
   }
-  // XXX: Should the `msw2posixpath(curr_prefix)` below move here?
+  msw2posixpath(curr_prefix);
 #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);
 #endif

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

Reply via email to