From dc35cb8e1601bba096af590d679c20ff149b4b6a Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Sat, 24 Apr 2004 18:30:23 +0000
Subject: [PATCH] use napms() instead of nanosleep(), as it does the same thing
 (aside from taking an argument in milliseconds instead of microseconds) and
 curses includes it

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1719 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog   |  4 ++++
 src/winio.c | 10 +---------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 677df034..574e891c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -64,6 +64,10 @@ CVS code -
 	  generated by the NumLock glitch. (DLR)
   edit_refresh()
 	- Remove apparently unneeded leaveok() calls. (David Benbennick)
+  do_credits()
+	- Use napms() instead of nanosleep(), as it does the same thing
+	  (aside from taking an argument in milliseconds instead of
+	  microseconds) and curses includes it. (DLR)
 - nano.texi:
 	- Fix inaccuracies: Meta-L now toggles line wrapping, and Meta-<
 	  and Meta-> aren't toggles. (DLR)
diff --git a/src/winio.c b/src/winio.c
index 57f1efba..28e63ef9 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -30,10 +30,6 @@
 #include "proto.h"
 #include "nano.h"
 
-#ifdef NANO_EXTRA
-#include <time.h>
-#endif
-
 static int statblank = 0;	/* Number of keystrokes left after
 				   we call statusbar(), before we
 				   actually blank the statusbar */
@@ -2658,7 +2654,6 @@ void dump_buffer_reverse(void)
 void do_credits(void)
 {
     int i, j = 0, k, place = 0, start_x;
-    struct timespec scrolldelay;
 
     const char *what;
     const char *xlcredits[XLCREDIT_LEN];
@@ -2722,9 +2717,6 @@ void do_credits(void)
     xlcredits[6] = _("and anyone else we forgot...");
     xlcredits[7] = _("Thank you for using nano!\n");
 
-    scrolldelay.tv_sec = 0;
-    scrolldelay.tv_nsec = 700000000;
-
     curs_set(0);
     nodelay(edit, TRUE);
     blank_bottombars();
@@ -2756,7 +2748,7 @@ void do_credits(void)
 		start_x = COLS / 2 - strlen(what) / 2 - 1;
 		mvwaddstr(edit, i * 2 - k, start_x, what);
 	    }
-	    nanosleep(&scrolldelay, NULL);
+	    napms(700);
 	    wrefresh(edit);
 	}
 	if (j < editwinrows / 2 - 1)
-- 
GitLab