srogue: use functions from mdport.c.

Shell escape, passwd entries, terminal settings, and most signal
handling is now done with the more portable md_* functions.
This commit is contained in:
John "Elwin" Edwards 2014-04-30 14:46:30 -07:00
parent de1e0f2759
commit 791df4324f
10 changed files with 34 additions and 115 deletions

View file

@ -15,14 +15,10 @@
*/
#include <stdlib.h>
#include <termios.h>
#include <ctype.h>
#include "rogue.h"
#include <pwd.h>
#include "rogue.ext"
extern struct termios terminal;
/*
* whatis:
* What a certain object is
@ -359,9 +355,9 @@ passwd()
mpos = 0;
sp = buf;
while ((c = getchar()) != '\n' && c != '\r' && c != ESCAPE)
if (c == terminal.c_cc[VKILL])
if (c == md_killchar())
sp = buf;
else if (c == terminal.c_cc[VERASE] && sp > buf)
else if (c == md_erasechar() && sp > buf)
sp--;
else
*sp++ = c;