summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/diff.c9
-rw-r--r--editors/sed.c8
2 files changed, 4 insertions, 13 deletions
diff --git a/editors/diff.c b/editors/diff.c
index 4e51f6f..26f3527 100644
--- a/editors/diff.c
+++ b/editors/diff.c
@@ -1289,14 +1289,9 @@ int diff_main(int argc ATTRIBUTE_UNUSED, char **argv)
while (L_arg) {
if (label1 && label2)
bb_show_usage();
- if (!label1)
- label1 = L_arg->data;
- else { /* then label2 is NULL */
+ if (label1) /* then label2 is NULL */
label2 = label1;
- label1 = L_arg->data;
- }
- /* we leak L_arg here... */
- L_arg = L_arg->link;
+ label1 = llist_pop(&L_arg);
}
/*
diff --git a/editors/sed.c b/editors/sed.c
index 817840d..bf01fc6 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -1267,21 +1267,17 @@ int sed_main(int argc ATTRIBUTE_UNUSED, char **argv)
if (opt & 0x2) G.regex_type |= REG_EXTENDED; // -r
//if (opt & 0x4) G.be_quiet++; // -n
while (opt_e) { // -e
- add_cmd_block(opt_e->data);
- opt_e = opt_e->link;
- /* we leak opt_e here... */
+ add_cmd_block(llist_pop(&opt_e));
}
while (opt_f) { // -f
char *line;
FILE *cmdfile;
- cmdfile = xfopen(opt_f->data, "r");
+ cmdfile = xfopen(llist_pop(&opt_f), "r");
while ((line = xmalloc_fgetline(cmdfile)) != NULL) {
add_cmd(line);
free(line);
}
fclose(cmdfile);
- opt_f = opt_f->link;
- /* we leak opt_f here... */
}
/* if we didn't get a pattern from -e or -f, use argv[0] */
if (!(opt & 0x18)) {