gbranden pushed a commit to branch master
in repository groff.
commit dc500a00049bc4df918243d58dc1b0bd90c68259
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Jun 19 05:24:53 2022 -0500
[groff]: Trivially refactor.
* src/roff/groff/groff.cpp (main): Rename temporary variable to avoid
shadowing one in enclosing scope, which can lead to cut-and-paste
errors (ask me how I know).
---
ChangeLog | 6 ++++++
src/roff/groff/groff.cpp | 10 +++++-----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e4b25685..79efbb4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-06-19 G. Branden Robinson <[email protected]>
+
+ * src/roff/groff/groff.cpp (main): Rename temporary variable to
+ avoid shadowing one in enclosing scope, which can lead to
+ cut-and-paste errors (ask me how I know).
+
2022-06-19 G. Branden Robinson <[email protected]>
* src/roff/groff/groff.cpp: Slightly refactor to indirect
diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index 3ff886e5..32525f43 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -477,12 +477,12 @@ int main(int argc, char **argv)
// we save the original path in GROFF_PATH__ and put it into the
// environment -- troff will pick it up later.
char *path = getenv("PATH");
- string e = "GROFF_PATH__";
- e += '=';
+ string g = "GROFF_PATH__";
+ g += '=';
if (path && *path)
- e += path;
- e += '\0';
- xputenv(strsave(e.contents()));
+ g += path;
+ g += '\0';
+ xputenv(strsave(g.contents()));
char *binpath = getenv("GROFF_BIN_PATH");
string f = "PATH";
f += '=';
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit