git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Usermode/libunicode - Add C++ wrappers
[tpg/acess2.git]
/
Usermode
/
Libraries
/
libreadline.so_src
/
main.c
diff --git
a/Usermode/Libraries/libreadline.so_src/main.c
b/Usermode/Libraries/libreadline.so_src/main.c
index
a12abc5
..
5937c6b
100644
(file)
--- a/
Usermode/Libraries/libreadline.so_src/main.c
+++ b/
Usermode/Libraries/libreadline.so_src/main.c
@@
-10,6
+10,7
@@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <errno.h>
#define STDIN_FD 0
#define STDOUT_FD 1
#define STDIN_FD 0
#define STDOUT_FD 1
@@
-105,6
+106,7
@@
char *Readline_NonBlock(tReadline *Info)
}
// Return NULL when command is still being edited
}
// Return NULL when command is still being edited
+ errno = EAGAIN;
return NULL;
}
return NULL;
}
@@
-116,7
+118,7
@@
char *Readline(tReadline *Info)
struct ptymode mode = {.InputMode = 0, .OutputMode = 0};
_SysIOCtl(STDIN_FD, PTY_IOCTL_SETMODE, &mode);
struct ptymode mode = {.InputMode = 0, .OutputMode = 0};
_SysIOCtl(STDIN_FD, PTY_IOCTL_SETMODE, &mode);
- while( NULL == (ret = Readline_NonBlock(Info)) );
+ while( NULL == (ret = Readline_NonBlock(Info))
&& errno == EAGAIN
);
// stty +echo,canon
mode.InputMode = PTYIMODE_CANON|PTYIMODE_ECHO;
// stty +echo,canon
mode.InputMode = PTYIMODE_CANON|PTYIMODE_ECHO;
@@
-280,7
+282,7
@@
int Readline_int_ParseCharacter(tReadline *Info, char *Input)
case '\b':
if(Info->BufferWritePos <= 0) break; // Protect against underflows
// Write the backsapce
case '\b':
if(Info->BufferWritePos <= 0) break; // Protect against underflows
// Write the backsapce
- _SysWrite(STDOUT_FD,
&ch, 1
);
+ _SysWrite(STDOUT_FD,
"\b \b", 3
);
if(Info->BufferWritePos == Info->BufferUsed) // Simple case: End of string
{
Info->BufferUsed --;
if(Info->BufferWritePos == Info->BufferUsed) // Simple case: End of string
{
Info->BufferUsed --;
UCC
git Repository :: git.ucc.asn.au