avoid clipping message when reading comments (Hartley)

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1384 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 16 years ago
parent 51f9c17a15
commit bfcc7becba

@ -1,5 +1,8 @@
2008-10-28 Arnim Laeuger <arniml@users.sourceforge.net>
* src/cmd/parse.c (jtag_parse_stream): avoid clipping message when
reading comments (Hartley)
* renamed data/lattice/lfec2-12e/lfec2_12e to lfec2-12e
* data/MANUFACTURERS, data/lattice/lfec2-12e, data/lattice/lfec2-12e/lfec2_12e,

@ -1,5 +1,5 @@
/*
* parse.c
* $Id$
*
* Copyright (C) 2002, 2003 ETC s.r.o.
*
@ -116,19 +116,22 @@ int
jtag_parse_stream( chain_t *chain, FILE *f )
{
char inputline[MAXINPUTLINE + 1];
int go = 1, i, c, lnr, clip;
int go = 1, i, c, lnr, clip, found_comment;
/* read the stream line-by-line until EOF or "quit" */
lnr = 0;
do {
i = 0;
clip = 0;
found_comment = 0;
/* read stream until '\n' or EOF, copy at most MAXINPUTLINE-1 chars */
while (1) {
c = fgetc(f);
if (c == EOF || c == '\n')
break;
if (c == '#')
found_comment = 1;
if (i < sizeof(inputline) - 1)
inputline[i++] = c;
else
@ -136,7 +139,7 @@ jtag_parse_stream( chain_t *chain, FILE *f )
}
inputline[i] = '\0';
lnr++;
if (clip)
if (clip && !found_comment)
fprintf(stdout, "Warning: line %d exceeds %d characters, clipped\n", lnr, (int)sizeof(inputline) - 1);
go = jtag_parse_line(chain, inputline);
}

Loading…
Cancel
Save