groff-commit
[Top][All Lists]
Advanced

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

[groff] 03/06: src/libs/libgroff/relocate.cpp: Move #ifdef again.


From: G. Branden Robinson
Subject: [groff] 03/06: src/libs/libgroff/relocate.cpp: Move #ifdef again.
Date: Thu, 14 Jan 2021 03:42:58 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 592efe54869d3cc8adc14af2d27edf573141beec
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Jan 12 12:45:21 2021 +1100

    src/libs/libgroff/relocate.cpp: Move #ifdef again.
    
    * src/libs/libgroff/relocate.cpp (set_current_prefix) [WIN32]: Move
      declaration of `pathextstr` to lie within preprocessor conditional,
      since it is dereferenced only there.
---
 ChangeLog                      | 6 ++++++
 src/libs/libgroff/relocate.cpp | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 493909e..59abb27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-12  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/libs/libgroff/relocate.cpp (set_current_prefix) [WIN32]:
+       Move declaration of `pathextstr` to lie within preprocessor
+       conditional, since it is dereferenced only there.
+
 2021-01-10  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        Add support for strsignal().
diff --git a/src/libs/libgroff/relocate.cpp b/src/libs/libgroff/relocate.cpp
index 6625e25..f18ad32 100644
--- a/src/libs/libgroff/relocate.cpp
+++ b/src/libs/libgroff/relocate.cpp
@@ -159,11 +159,11 @@ char *msw2posixpath(char *path)
 // Compute the current prefix.
 void set_current_prefix()
 {
-  char *pathextstr;
   // Obtain the full path of the current binary;
   // using GetModuleFileName on MS-Windows,
   // and searching along PATH on other systems.
 #ifdef _WIN32
+  char *pathextstr;
   curr_prefix = new char[path_name_max()];
   int len = GetModuleFileName(0, curr_prefix, path_name_max());
   if (len)



reply via email to

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