Browse Source

Fix up some libs to work better under linux

K. Lange 4 years ago
parent
commit
c678b6562d
2 changed files with 4 additions and 0 deletions
  1. 3 0
      lib/rline.c
  2. 1 0
      lib/rline_exp.c

+ 3 - 0
lib/rline.c

@@ -9,9 +9,12 @@
  * complex line editing than what the raw tty interface supplies.
  */
 
+#define _POSIX_C_SOURCE 1
+#define _XOPEN_SOURCE 500
 #include <stdint.h>
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <termios.h>
 

+ 1 - 0
lib/rline_exp.c

@@ -1279,6 +1279,7 @@ static void get_initial_termios(void) {
 static void set_unbuffered(void) {
 	struct termios new = old;
 	new.c_lflag &= (~ICANON & ~ECHO);
+	new.c_cc[VINTR] = 0;
 	tcsetattr(STDOUT_FILENO, TCSAFLUSH, &new);
 }