Skip to content

Commit 91f9757

Browse files
committed
allow alphadata to also contain literal values, in addition to characters
1 parent 860e9ab commit 91f9757

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

statements.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7673,8 +7673,28 @@ void alphadata (char **statement)
76737673
alphaend = strrchr (data, '\'');
76747674
if ((alphaend == NULL) || (alphachr == alphaend) || (alphachr == (alphaend - 1)))
76757675
{
7676-
prerror ("malformed alphadata line");
7677-
exit (1);
7676+
int t, hasnum;
7677+
hasnum=0;
7678+
for(t=0;((t<SIZEOFSTATEMENT)&&(data[t]!=0));t++)
7679+
{
7680+
if ((data[t]>='0')&&(data[t]<='9'))
7681+
{
7682+
hasnum=1;
7683+
break;
7684+
}
7685+
}
7686+
if (!hasnum)
7687+
{
7688+
prerror ("malformed alphadata line");
7689+
exit (1);
7690+
}
7691+
// We see a digit in there. We'll take it on faith that there's
7692+
// valid data listed. Validity checking here could be better.
7693+
if (!thisdatabankset)
7694+
printf (" .byte %s\n", data);
7695+
else
7696+
gfxprintf (" .byte %s\n", data);
7697+
continue;
76787698
}
76797699
alphachr = alphachr + 1;
76807700
*alphaend = '\0';

0 commit comments

Comments
 (0)