gbranden pushed a commit to branch master
in repository groff.
commit ba098ad1dc1405c59d762cc23d0ca7a476bac356
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Jun 22 20:28:43 2022 -0500
[groff]: Trivially refactor.
* src/roff/groff/groff.cpp (run_commands): Trivially refactor. Rename
variable for clarity; add comment.
---
ChangeLog | 5 +++++
src/roff/groff/groff.cpp | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d20a86e9..a409e7af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-06-27 G. Branden Robinson <[email protected]>
+
+ * src/roff/groff/groff.cpp (run_commands): Trivially refactor.
+ Rename variable for clarity; add comment.
+
2022-06-27 G. Branden Robinson <[email protected]>
* src/preproc/html/pre-html.cpp
diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index 6315f4f9..b9c9f416 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -609,12 +609,12 @@ void print_commands(FILE *fp)
int run_commands(int no_pipe)
{
- char **v[NCOMMANDS];
- int j = 0;
+ char **v[NCOMMANDS]; // vector of argv arrays to pipe together
+ int ncommands = 0;
for (int i = 0; i < NCOMMANDS; i++)
if (commands[i].get_name() != 0 /* nullptr */)
- v[j++] = commands[i].get_argv();
- return run_pipeline(j, v, no_pipe);
+ v[ncommands++] = commands[i].get_argv();
+ return run_pipeline(ncommands, v, no_pipe);
}
possible_command::possible_command()
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit