aboutsummaryrefslogtreecommitdiff
path: root/src/cmdline.opt
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmdline.opt')
-rw-r--r--src/cmdline.opt24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt
index 4c3d22f..afa1949 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -14,8 +14,7 @@
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with wydawca. If not, see <http://www.gnu.org/licenses/>. */ 15 with wydawca. If not, see <http://www.gnu.org/licenses/>. */
16 16
17static struct obstack pp_cmd_stack; 17static struct txtacc *pp_cmd_acc;
18static int pp_cmd_stack_init;
19 18
20static struct grecs_list *source_list; 19static struct grecs_list *source_list;
21static struct grecs_list *tag_list; 20static struct grecs_list *tag_list;
@@ -152,19 +151,16 @@ OPTION(define,D,SYMBOL[=VALUE],
152BEGIN 151BEGIN
153 char *p; 152 char *p;
154 153
155 if (!pp_cmd_stack_init) 154 if (!pp_cmd_acc)
156 { 155 pp_cmd_acc = txtacc_create ();
157 obstack_init (&pp_cmd_stack); 156 txtacc_grow (pp_cmd_acc, " \"-D", 4);
158 pp_cmd_stack_init = 1;
159 }
160 obstack_grow (&pp_cmd_stack, " \"-D", 4);
161 for (p = optarg; *p; p++) 157 for (p = optarg; *p; p++)
162 { 158 {
163 if (*p == '\\' || *p == '"') 159 if (*p == '\\' || *p == '"')
164 obstack_1grow (&pp_cmd_stack, '\\'); 160 txtacc_1grow (pp_cmd_acc, '\\');
165 obstack_1grow (&pp_cmd_stack, *p); 161 txtacc_1grow (pp_cmd_acc, *p);
166 } 162 }
167 obstack_1grow (&pp_cmd_stack, '"'); 163 txtacc_1grow (pp_cmd_acc, '"');
168END 164END
169 165
170OPTION(preprocessor,,COMMAND, 166OPTION(preprocessor,,COMMAND,
@@ -213,13 +209,13 @@ void
213parse_options(int argc, char *argv[]) 209parse_options(int argc, char *argv[])
214{ 210{
215 GETOPT(argc, argv) 211 GETOPT(argc, argv)
216 if (pp_cmd_stack_init && grecs_preprocessor) 212 if (pp_cmd_acc && grecs_preprocessor)
217 { 213 {
218 char *defs = obstack_finish (&pp_cmd_stack); 214 char *defs = txtacc_finish (pp_cmd_acc);
219 char *cmd = xmalloc (strlen (grecs_preprocessor) + strlen (defs) + 1); 215 char *cmd = xmalloc (strlen (grecs_preprocessor) + strlen (defs) + 1);
220 strcpy (cmd, grecs_preprocessor); 216 strcpy (cmd, grecs_preprocessor);
221 strcat (cmd, defs); 217 strcat (cmd, defs);
222 grecs_preprocessor = cmd; 218 grecs_preprocessor = cmd;
223 obstack_free (&pp_cmd_stack, NULL); 219 txtacc_free (pp_cmd_acc);
224 } 220 }
225} 221}

Return to:

Send suggestions and report system problems to the System administrator.