- if(!(input->mode&LINE_BUFFERED)) {
- tios.c_lflag&=(~ICANON);
- tios.c_lflag&=(~ECHO);
- tios.c_cc[VTIME]=0;
- tios.c_cc[VMIN]=1;
- tcsetattr(0,TCSANOW,&tios);
- }
+ /* general settings */
+ tios.c_iflag&=ICRNL; /* \r -> \n */
+ tios.c_cc[VTIME]=0; /* no timeout */
+ tios.c_cc[VMIN]=1; /* 1 char for non-can. mode */
+
+ /* depending on used modes */
+ if(!(input->mode&LINE_BUFFERED)) tios.c_lflag&=(~ICANON);
+ if(!(input->mode&INPUT_ECHO)) tios.c_lflag&=(~ECHO);
+
+ tcsetattr(0,TCSANOW,&tios);