#include <string.h>\r
#include "header.h"\r
#include <readline.h>\r
+#include <errno.h>\r
\r
#define _stdin 0\r
#define _stdout 1\r
// Read Command line\r
sCommandStr = Readline( readline_state );\r
printf("\n");\r
+ if( !sCommandStr ) {\r
+ perror("Readline");\r
+ return 1;\r
+ }\r
\r
// Parse Command Line into arguments\r
iArgCount = Parse_Args(sCommandStr, saArgs);\r
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <errno.h>
#define STDIN_FD 0
#define STDOUT_FD 1
}
// Return NULL when command is still being edited
+ errno = EAGAIN;
return NULL;
}
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;