re-number the lines during copying,

required by nupa_copy()
This commit is contained in:
Holger Vogt 2018-08-17 21:21:29 +02:00
parent f9eb75f55d
commit 2dfdf984d6
1 changed files with 3 additions and 2 deletions

View File

@ -728,7 +728,7 @@ struct card *
inp_deckcopy_oc(struct card *deck) inp_deckcopy_oc(struct card *deck)
{ {
struct card *d = NULL, *nd = NULL; struct card *d = NULL, *nd = NULL;
int skip_control = 0; int skip_control = 0, i = 0;
while (deck) { while (deck) {
/* exclude any command inside .control ... .endc */ /* exclude any command inside .control ... .endc */
@ -753,7 +753,8 @@ inp_deckcopy_oc(struct card *deck)
else { else {
nd = d = TMALLOC(struct card, 1); nd = d = TMALLOC(struct card, 1);
} }
d->linenum = deck->linenum; d->linenum_orig = deck->linenum;
d->linenum = i++;
d->line = copy(deck->line); d->line = copy(deck->line);
if (deck->error) if (deck->error)
d->error = copy(deck->error); d->error = copy(deck->error);