#ident "lib/libsc/cmd/menu_cmd.c: $Revision: 1.34 $"
/*
*
* The menu mechanics are in lib/menu.c, this file defines the contents
* and implementation of the menu.
*
*/
#include "setjmp.h"
#include
#include
#include
#include
#include
#include
extern jmp_buf restart_buf;
/*
* Find the installation tape
*
*/
int
sa_get_response( char *rbuf )
{
int c, i, j;
i = 0;
/*
** duplicate the line discipline to add escape.
*/
p_curson ();
do {
c = getchar();
switch( c ) {
case '\n':
case '\r':
putchar( '\n' );
rbuf[i] = '\000';
return( 0 );
case '\004':
case '\033':
longjmp( restart_buf, 1);
/* should not get here */
break;
case '\025':
for (j=0;j0) {
putchar( '\b' );
putchar( ' ' );
putchar( '\b' );
i = i -1;
}
rbuf[i] = '\000';
break;
default:
rbuf[i++] = (char)c;
rbuf[i] = '\000';
putchar( c );
break;
}
} while (i