]> code.citadel.org Git - citadel.git/blobdiff - citadel/screen.c
- fixes for building without OpenSSL
[citadel.git] / citadel / screen.c
index 3d8f7766b87db268c50a450377b7d5892cc1b536..7e1d1e770da10317306082e931515f596c134f71 100644 (file)
@@ -13,7 +13,7 @@
 #include <stdarg.h>
 #include <unistd.h>
 #include <sys/types.h>
-#ifdef VW_PRINTW_IN_CURSES
+#ifdef HAVE_VW_PRINTW
 #define _vwprintw vw_printw
 #else
 /* Ancient curses implementations, this needs testing. Anybody got XENIX? */
@@ -269,12 +269,14 @@ int sln_printf_if(char *fmt, ...)
 
 int scr_getc(void)
 {
+  char buf;
 #ifdef HAVE_CURSES_H
-    /* This looks scary, the program will hang if mainwindow is null */
        if (mainwindow)
                return wgetch(mainwindow);
 #endif
-       return getchar();
+  buf = '\0';
+  read (0, &buf, 1);
+       return buf;
 }
 
 int scr_blockread(void)
@@ -334,7 +336,9 @@ int scr_color(int colornum)
 {
 #ifdef HAVE_CURSES_H
        if (mainwindow) {
+#ifdef HAVE_WCOLOR_SET
                wcolor_set(mainwindow, 1 + (colornum & 7), NULL);
+#endif
                if (colornum & 8) {
                        wattron(mainwindow, A_BOLD);
                } else {