From: Francois Fleuret Date: Wed, 18 Mar 2009 07:30:29 +0000 (+0100) Subject: Cosmetics. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=0fde38cd434c19ecb1083f03b2806d52f53cec9c;p=selector.git Cosmetics. --- diff --git a/selector.cc b/selector.cc index f8d133e..42c36a3 100644 --- a/selector.cc +++ b/selector.cc @@ -56,16 +56,14 @@ int use_regexp = 0; ////////////////////////////////////////////////////////////////////// -// This looks severely Linux-only ... - -void inject_into_tty_buffer(char *line) { +void inject_into_tty_buffer(char *string) { struct termios oldtio, newtio; - tcgetattr(STDIN_FILENO,&oldtio); + tcgetattr(STDIN_FILENO, &oldtio); memset(&newtio, 0, sizeof(newtio)); // Set input mode (non-canonical, *no echo*,...) tcsetattr(STDIN_FILENO, TCSANOW, &newtio); - // Put the selected line in the tty input buffer - for(char *k = line; *k; k++) { + // Put the selected string in the tty input buffer + for(char *k = string; *k; k++) { ioctl(STDIN_FILENO, TIOCSTI, k); } // Restore the old settings