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 @@
You should have received a copy of the GNU General Public License along
with wydawca. If not, see <http://www.gnu.org/licenses/>. */
-static struct obstack pp_cmd_stack;
-static int pp_cmd_stack_init;
+static struct txtacc *pp_cmd_acc;
static struct grecs_list *source_list;
static struct grecs_list *tag_list;
@@ -152,19 +151,16 @@ OPTION(define,D,SYMBOL[=VALUE],
BEGIN
char *p;
- if (!pp_cmd_stack_init)
- {
- obstack_init (&pp_cmd_stack);
- pp_cmd_stack_init = 1;
- }
- obstack_grow (&pp_cmd_stack, " \"-D", 4);
+ if (!pp_cmd_acc)
+ pp_cmd_acc = txtacc_create ();
+ txtacc_grow (pp_cmd_acc, " \"-D", 4);
for (p = optarg; *p; p++)
{
if (*p == '\\' || *p == '"')
- obstack_1grow (&pp_cmd_stack, '\\');
- obstack_1grow (&pp_cmd_stack, *p);
+ txtacc_1grow (pp_cmd_acc, '\\');
+ txtacc_1grow (pp_cmd_acc, *p);
}
- obstack_1grow (&pp_cmd_stack, '"');
+ txtacc_1grow (pp_cmd_acc, '"');
END
OPTION(preprocessor,,COMMAND,
@@ -213,13 +209,13 @@ void
parse_options(int argc, char *argv[])
{
GETOPT(argc, argv)
- if (pp_cmd_stack_init && grecs_preprocessor)
+ if (pp_cmd_acc && grecs_preprocessor)
{
- char *defs = obstack_finish (&pp_cmd_stack);
+ char *defs = txtacc_finish (pp_cmd_acc);
char *cmd = xmalloc (strlen (grecs_preprocessor) + strlen (defs) + 1);
strcpy (cmd, grecs_preprocessor);
strcat (cmd, defs);
grecs_preprocessor = cmd;
- obstack_free (&pp_cmd_stack, NULL);
+ txtacc_free (pp_cmd_acc);
}
}

Return to:

Send suggestions and report system problems to the System administrator.