spice2g6 poly(19 compat:

When counting token, count an expression {...} for the
gain as a single token, even if it contains spaces.
This commit is contained in:
Holger Vogt 2020-12-04 17:29:24 +01:00
parent ced7604fc4
commit fe24a4135c
1 changed files with 16 additions and 2 deletions

View File

@ -9157,7 +9157,14 @@ static void inp_poly_2g6_compat(struct card* deck) {
case 'e':
curr_line = nexttok(curr_line);
curr_line = nexttok(curr_line);
curr_line = nexttok(curr_line);
/* The next token may be a simple text token or an expression
enclosed in brackets */
if (*curr_line == '{') {
char* tmptok = gettok_char(&curr_line, '}', TRUE, TRUE);
tfree(tmptok);
}
else
curr_line = nexttok(curr_line);
if (!curr_line) {
fprintf(stderr, "Error: not enough parameters in line\n %s\n", thisline);
controlled_exit(1);
@ -9168,7 +9175,14 @@ static void inp_poly_2g6_compat(struct card* deck) {
case 'f':
case 'h':
curr_line = nexttok(curr_line);
curr_line = nexttok(curr_line);
/* The next token may be a simple text token or an expression
enclosed in brackets */
if (*curr_line == '{') {
char* tmptok = gettok_char(&curr_line, '}', TRUE, TRUE);
tfree(tmptok);
}
else
curr_line = nexttok(curr_line);
if (!curr_line) {
fprintf(stderr, "Error: not enough parameters in line\n %s\n", thisline);
controlled_exit(1);