static void append(char *s)
{
- llist_add_to_end(&G.append_head, xstrdup(s));
+ llist_add_to_end(&G.append_head, s);
}
static void flush_append(void)
/* Append line to linked list to be printed later */
case 'a':
- append(sed_cmd->string);
+ append(xstrdup(sed_cmd->string));
break;
/* Insert text before this line */
rfile = fopen_for_read(sed_cmd->string);
if (rfile) {
char *line;
-
while ((line = xmalloc_fgetline(rfile))
!= NULL)
append(line);
- xprint_and_close_file(rfile);
+ fclose(rfile);
}
break;