summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/ncftp/main.c12
-rw-r--r--usr.bin/ncftp/sys.h6
2 files changed, 15 insertions, 3 deletions
diff --git a/usr.bin/ncftp/main.c b/usr.bin/ncftp/main.c
index b0a11c4dbca6..80b5015816b6 100644
--- a/usr.bin/ncftp/main.c
+++ b/usr.bin/ncftp/main.c
@@ -29,6 +29,10 @@
# endif
#endif /* CURSES */
+#if defined(CURSES) && defined(SGTTYB)
+# include <sgtty.h>
+#endif
+
#include "util.h"
#include "cmds.h"
#include "main.h"
@@ -1104,6 +1108,10 @@ int termcap_get(char **dest, char *attr)
void termcap_init(void)
{
char *term;
+#ifdef SGTTYB
+ struct sgttyb ttyb;
+ extern short ospeed;
+#endif
if ((term = getenv("TERM")) == NULL) {
term = "dumb"; /* TAR */
@@ -1123,6 +1131,10 @@ void termcap_init(void)
tcl_bold = strlen(tcap_boldface);
tcl_uline = strlen(tcap_underline);
tcl_rev = strlen(tcap_reverse);
+#ifdef SGTTYB
+ if (ioctl(fileno(stdout), TIOCGETP, &ttyb) == 0)
+ ospeed = ttyb.sg_ospeed;
+#endif
}
} /* termcap_init */
diff --git a/usr.bin/ncftp/sys.h b/usr.bin/ncftp/sys.h
index d009caa050ba..66ed9cd3f89b 100644
--- a/usr.bin/ncftp/sys.h
+++ b/usr.bin/ncftp/sys.h
@@ -446,10 +446,10 @@ extern int errno;
# ifndef SYSDIRH
# define SYSDIRH 1
# endif
-# ifndef SGTTYB
-# define SGTTYB
-# endif
# endif
+# ifndef SGTTYB
+# define SGTTYB
+# endif
#endif
/*