Sorry - the last one didn't include printing of the prompt - I was mostly concerned with getting exmh to work.... *** ruserpass.c.orig Fri Apr 30 14:08:34 1999 --- ruserpass.c Mon Nov 29 14:45:04 1999 *************** *** 178,183 **** --- 178,210 ---- return(-1); } + #include <termios.h> + char *getpass(const char *prompt) + { + static char buff[50]; + char *s; + struct termios tio, tioO; + int in; + + fputs(prompt, stdout); + fflush(stdout); + + in = fileno(stdin); + tcgetattr(in, &tioO); + tio = tioO; + tio.c_lflag &= ~ECHO; + tcsetattr(in, TCSANOW, &tio); + + s = fgets(buff, sizeof(buff), stdin); + if (!s) buff[0] = 0; + + tcsetattr(in, TCSANOW, &tioO); + + if (buff[strlen(buff)-1] == '\n') buff[strlen(buff)-1] = 0; + + return buff; + } + static int token(void) {