mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-03 02:41:08 +00:00
Handle ^Z in dietline and fix build target
This commit is contained in:
parent
44ee3ce8d2
commit
d2c48b1358
@ -4,3 +4,5 @@ OBJ=line.o
|
||||
#LINK=-L../cons -lr_cons -Wl,-R../cons ../util/*.a
|
||||
|
||||
include ../rules.mk
|
||||
|
||||
line.o: dietline.c
|
||||
|
@ -53,15 +53,14 @@ static int r_line_readchar() {
|
||||
#else
|
||||
do {
|
||||
int ret = read (0, buf, 1);
|
||||
if (ret == -1)
|
||||
return 0; // read no char
|
||||
if (ret == 0) // EOF
|
||||
return -1;
|
||||
//eprintf ("(((%x)))\n", *buf);
|
||||
if (ret == -1) return 0; // read no char
|
||||
if (ret == 0) return -1; // eof
|
||||
// TODO: add support for other invalid chars
|
||||
if (*buf==0x1a) { // ^Z
|
||||
kill (getpid (), SIGSTOP);
|
||||
}
|
||||
if (*buf==0xc2 || *buf==0xc3) {
|
||||
read (0, buf+1, 1);
|
||||
//eprintf ("(((%x)))\n", buf[1]);
|
||||
*buf = '\0';
|
||||
}
|
||||
} while (*buf == '\0');
|
||||
|
Loading…
Reference in New Issue
Block a user