summaryrefslogtreecommitdiff
path: root/lib/libforms
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1995-01-10 12:36:44 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1995-01-10 12:36:44 +0000
commit4c0b41ec3bc54b6bf01f4f5a18996cfe4b0b8cb3 (patch)
treee065a51499b3a3bf6683a5cb688430a7cd06c229 /lib/libforms
parent8b9d60735d11b03eac340f1e7802ff8c86742f92 (diff)
Notes
Diffstat (limited to 'lib/libforms')
-rw-r--r--lib/libforms/examples/Makefile9
-rw-r--r--lib/libforms/examples/test.c7
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/libforms/examples/Makefile b/lib/libforms/examples/Makefile
index 36e782ea47d7..9a79a061a7be 100644
--- a/lib/libforms/examples/Makefile
+++ b/lib/libforms/examples/Makefile
@@ -4,6 +4,13 @@ NOMAN = yet
SRCS = test.c
CFLAGS =
-LDADD = -lforms -lncurses -lmytinfo
+
+.if exists(${.CURDIR}/../obj)
+FORMDIR=${.CURDIR}/../obj
+.else
+FORMDIR=${.CURDIR}/..
+.endif
+
+LDADD = -L${FORMDIR} -lforms -lncurses -lmytinfo
.include <bsd.prog.mk>
diff --git a/lib/libforms/examples/test.c b/lib/libforms/examples/test.c
index 1fc3836a2f84..92e65a8ae981 100644
--- a/lib/libforms/examples/test.c
+++ b/lib/libforms/examples/test.c
@@ -12,6 +12,7 @@
* its use.
*/
+#include <stdio.h>
#include "../forms.h"
main()
@@ -68,7 +69,11 @@ main()
initscr();
initfrm(&form);
-
+ if (!form.window) {
+ fprintf(stderr, "\nUnable to initialize forms library.\n");
+ endwin();
+ exit(1);
+ }
keypad(form.window, TRUE);
while (!(res = update_form(&form)));