Mail Archives: djgpp/1993/01/26/15:00:21
I obtained PDcurses 2.0 (rwolf AT dretor DOT dciem DOT dnd DOT ca),
I obtained the patches for DJGPP (davidn AT csource DOT oz DOT au),
I applied the patches (with some difficulties) using the DJGPP patch program,
I obtained a copy of the DMAKE program,
I compiled the whole package, et voila, a first question !
When I compile the test program below (tcurses.c) on a UNIX system,
I get something like:
Curses test program.
Input: hello
Input: hello
The PDcurses+DJGPP version of getstr(), however, seems to have some
different behaviour:
Curses test program.
Input: ==>helloInput: ==>hello
Segmentation violation in pointer 0x00000000 at 40:0
Exception 14 (0xe) at eip=0
Not only are the contents of the buffer 'buf' used in the
function 'getstr()' and is the newline not echoed (which is
different from my UNIX curses, but I could live with this feature),
the worst part is the crash of the program itself.
My question to anyone who uses PDcurses (and DJGPP):
(1) does this program crash on your system, too ?
(Perhaps I didn't compile the library right...)
(2) is it smart to redefine the functionality of such a basic
function like 'getscr()', or is my UNIX curses wrong ?
Any help/comment is appreciated.
Pieter Kunst (kunst AT prl DOT philips DOT nl)
-----------------------------------------------------------------------
tcurses.c:
-----------------------------------------------------------------------
#include <curses.h>
#include <string.h>
main()
{
char buf[100];
strcpy (buf, "==>");
initscr ();
echo ();
cbreak ();
printw ("Curses test program.\nInput: "); refresh();
getstr (buf);
printw ("Input: %s\n", buf); refresh();
/* endwin (); */
}
-----------------------------------------------------------------------
- Raw text -