diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 6a7258e2..58223530 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,7 @@ +2003-05-13 Marcel Telka + + * src/jtag.c (jtag_parse_file): Added support for command scripts from stdin. + 2003-04-29 Marcel Telka * data/MANUFACTURERS: Added new manufacturer: DEC. diff --git a/jtag/NEWS b/jtag/NEWS index 885074d3..e13be482 100644 --- a/jtag/NEWS +++ b/jtag/NEWS @@ -1,6 +1,7 @@ $Id$ * Added new manufacturer: DEC. + * Added support for executing scripts directly from stdin (parameter '-'). jtag-0.3.2 (2003-04-04): diff --git a/jtag/src/jtag.c b/jtag/src/jtag.c index 278f782d..e72bcb4b 100644 --- a/jtag/src/jtag.c +++ b/jtag/src/jtag.c @@ -747,7 +747,10 @@ jtag_parse_file( const char *filename ) char *line = NULL; int n = 0; - f = fopen( filename, "r" ); + if (strcmp( filename, "-" ) != 0) + f = fopen( filename, "r" ); + else + f = stdin; if (!f) return -1; @@ -756,7 +759,8 @@ jtag_parse_file( const char *filename ) go = jtag_parse_line(line); free(line); - fclose(f); + if (strcmp( filename, "-" ) != 0) + fclose(f); return go; }