aboutsummaryrefslogtreecommitdiff
path: root/src/cmdline.opt
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmdline.opt')
-rw-r--r--src/cmdline.opt14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt
index afa1949..f92f48f 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -211,11 +211,15 @@ parse_options(int argc, char *argv[])
211 GETOPT(argc, argv) 211 GETOPT(argc, argv)
212 if (pp_cmd_acc && grecs_preprocessor) 212 if (pp_cmd_acc && grecs_preprocessor)
213 { 213 {
214 char *defs = txtacc_finish (pp_cmd_acc); 214 char *cmd;
215 char *cmd = xmalloc (strlen (grecs_preprocessor) + strlen (defs) + 1); 215 size_t len = strlen (grecs_preprocessor);
216 strcpy (cmd, grecs_preprocessor); 216 txtacc_1grow (pp_cmd_acc, 0);
217 strcat (cmd, defs); 217 txtacc_grow (pp_cmd_acc, grecs_preprocessor, len + 1);
218 grecs_preprocessor = cmd; 218 cmd = txtacc_finish (pp_cmd_acc, 1);
219 txtacc_free (pp_cmd_acc); 219 txtacc_free (pp_cmd_acc);
220 memmove (cmd + len + 1, cmd, strlen (cmd) + 1);
221 memcpy (cmd, grecs_preprocessor, len);
222 cmd[len] = ' ';
223 grecs_preprocessor = cmd;
220 } 224 }
221} 225}

Return to:

Send suggestions and report system problems to the System administrator.