aboutsummaryrefslogtreecommitdiff
path: root/src/cmdline.opt
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-07-18 18:34:54 +0300
committerSergey Poznyakoff <gray@gnu.org>2019-07-18 18:34:54 +0300
commitf6657a46e2422d903d62565868f77c430a612a42 (patch)
treeb70b4f45003e067de55a8ac425792c98fd06035d /src/cmdline.opt
parent3a16bc5620b4c664248bc5b5c586ddd0103f7050 (diff)
downloadwydawca-f6657a46e2422d903d62565868f77c430a612a42.tar.gz
wydawca-f6657a46e2422d903d62565868f77c430a612a42.tar.bz2
Fix unnecessary code duplication
Use grecs_txtacc.
Diffstat (limited to 'src/cmdline.opt')
-rw-r--r--src/cmdline.opt20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt
index a0b1b37..c553e2e 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -15,7 +15,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 txtacc *pp_cmd_acc;
+static struct grecs_txtacc *pp_cmd_acc;
static struct grecs_list *source_list;
static struct grecs_list *tag_list;
@@ -152,14 +152,14 @@ BEGIN
char *p;
if (!pp_cmd_acc)
- pp_cmd_acc = txtacc_create ();
- txtacc_grow(pp_cmd_acc, " \"-D", 4);
+ pp_cmd_acc = grecs_txtacc_create ();
+ grecs_txtacc_grow(pp_cmd_acc, " \"-D", 4);
for (p = optarg; *p; p++) {
if (*p == '\\' || *p == '"')
- txtacc_1grow(pp_cmd_acc, '\\');
- txtacc_1grow(pp_cmd_acc, *p);
+ grecs_txtacc_grow_char(pp_cmd_acc, '\\');
+ grecs_txtacc_grow_char(pp_cmd_acc, *p);
}
- txtacc_1grow(pp_cmd_acc, '"');
+ grecs_txtacc_grow_char(pp_cmd_acc, '"');
END
OPTION(preprocessor,,COMMAND,
@@ -218,10 +218,10 @@ parse_options(int argc, char *argv[])
if (pp_cmd_acc && grecs_preprocessor) {
char *cmd;
size_t len = strlen(grecs_preprocessor);
- txtacc_1grow(pp_cmd_acc, 0);
- txtacc_grow(pp_cmd_acc, grecs_preprocessor, len + 1);
- cmd = txtacc_finish(pp_cmd_acc, 1);
- txtacc_free(pp_cmd_acc);
+ grecs_txtacc_grow_char(pp_cmd_acc, 0);
+ grecs_txtacc_grow(pp_cmd_acc, grecs_preprocessor, len + 1);
+ cmd = grecs_txtacc_finish(pp_cmd_acc, 1);
+ grecs_txtacc_free(pp_cmd_acc);
memmove(cmd + len + 1, cmd, strlen(cmd) + 1);
memcpy(cmd, grecs_preprocessor, len);
cmd[len] = ' ';

Return to:

Send suggestions and report system problems to the System administrator.