Formatting and added comments
This commit is contained in:
parent
082f36e794
commit
bfe660e57b
|
|
@ -700,8 +700,7 @@ doit(struct card *deck, wordlist *modnames) {
|
||||||
/*-------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------*/
|
||||||
/* Copy a deck, including the actual lines. */
|
/* Copy a deck, including the actual lines. */
|
||||||
/*-------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------*/
|
||||||
struct card *
|
struct card * inp_deckcopy(struct card *deck) {
|
||||||
inp_deckcopy(struct card *deck) {
|
|
||||||
struct card *d = NULL, *nd = NULL;
|
struct card *d = NULL, *nd = NULL;
|
||||||
|
|
||||||
while (deck) {
|
while (deck) {
|
||||||
|
|
@ -727,8 +726,7 @@ inp_deckcopy(struct card *deck) {
|
||||||
* without .control section(s).
|
* without .control section(s).
|
||||||
* First line is always copied (except being .control).
|
* First line is always copied (except being .control).
|
||||||
*/
|
*/
|
||||||
struct card *
|
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, i = 0;
|
int skip_control = 0, i = 0;
|
||||||
|
|
@ -749,26 +747,29 @@ inp_deckcopy_oc(struct card *deck)
|
||||||
deck = deck->nextcard;
|
deck = deck->nextcard;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (nd) {
|
if (nd) { /* First card already found */
|
||||||
d->nextcard = TMALLOC(struct card, 1);
|
/* d is the card at the end of the deck */
|
||||||
d = d->nextcard;
|
d = d->nextcard = TMALLOC(struct card, 1);
|
||||||
}
|
}
|
||||||
else {
|
else { /* This is the first card */
|
||||||
nd = d = TMALLOC(struct card, 1);
|
nd = d = TMALLOC(struct card, 1);
|
||||||
}
|
}
|
||||||
d->linenum_orig = deck->linenum;
|
d->linenum_orig = deck->linenum;
|
||||||
d->linenum = i++;
|
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);
|
||||||
|
}
|
||||||
d->actualLine = NULL;
|
d->actualLine = NULL;
|
||||||
deck = deck->nextcard;
|
deck = deck->nextcard;
|
||||||
while (deck && *(deck->line) == '*')
|
while (deck && *(deck->line) == '*') { /* skip comments */
|
||||||
deck = deck->nextcard;
|
deck = deck->nextcard;
|
||||||
}
|
}
|
||||||
|
} /* end of loop over cards in the source deck */
|
||||||
|
|
||||||
|
return nd;
|
||||||
|
} /* end of function inp_deckcopy_oc */
|
||||||
|
|
||||||
return (nd);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------
|
/*-------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue