Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#27 exit on end of file

closed-fixed
Marcel Telka
jtag (26)
5
2004-11-21
2003-12-11
Ico Doornekamp
No

Hi,

I have the feeling jtag does not properly respond to end-of-file on
standard
input. When I issue the following command, for example :

$ echo "peek 0x1234" | jtag

the command gets executed, and jtag starts looping very hard
reading more
input, which is not available ofcourse.

jtag> jtag> jtag> jtag> jtag> jtag> jtag> jtag> jtag> ... etc

imho the proper behaviour would be to exit the program on
end-of-file,
so it's also possible to exit interactive mode with ctrl-D.

The attached patch exits jtag when end of file is reached.

/Ico

Discussion

  • Ico Doornekamp
    Ico Doornekamp
    2003-12-11

    patch file

     
    Attachments
  • Andrew Dyer
    Andrew Dyer
    2004-10-17

    Logged In: YES
    user_id=912118

    I think this is an artifact of using readline() to get command
    input - it traps ctrl-d for it's own purposes (command line
    editing).

    I believe this patch will terminate on a single <CR> or on <EOF>
    as readline returns NULL for both cases, which doesn't seem like
    correct behavior, especially at the interactive command line.

    It looks like people often use isatty() to see if they're
    getting
    input from a tty and only use readline if that's the case.

     
  • Marcel Telka
    Marcel Telka
    2004-11-21

    Logged In: YES
    user_id=395402

    I've rewritten JTAG Tools' startup sequence to fix the
    problem. The changes are already in the CVS tree.

    Thanks.

     
  • Marcel Telka
    Marcel Telka
    2004-11-21

    • status: open --> closed-fixed
     
  • Marcel Telka
    Marcel Telka
    2004-11-21

    • labels: 477213 --> jtag