[comp.unix.ultrix] Problem with getstr

benchoff@groupw.cns.vt.edu (Phil Benchoff) (07/16/90)

getstr() is supposed to read a string terminated with carriage return or
newline, and use editing characters from termcap.   This works on other
Unix systems,  but under Ultrix I have to use ^h for delete and
have to end lines with newline. Enclosed is a sample program to demonstrate
the problem.

Works: NeXT, AIX
Doesn't work: Ultrix V3.1D (Rev. 54) 

Is this a bug in Ultrix,  or are there some other things I should check?
Everything seems to work (vi, etc) except for a program called Display,
which is part of the Internet Rover package from merit.edu.

----------------------------------------
/*
** curtest.c
**
** Compile with cc -O -o curtest curtest.c -lcurses -ltermcap
**
** Demonstrates a bug in getstr() function in the curses library.  The man
** pages claim that getstr() will read a string terminated with either
** carriage return or newline.  Only newline works.
*/

#include <stdio.h>
#include <curses.h>

main()
{
	char buf[255];

	initscr();
	getstr(buf);
	printf("You Typed: %s\n",buf);
	endwin();
}
---------------------------------
Phil Benchoff, benchoff@groupw.cns.vt.edu