Keep text file displayed until user hits enter - sacc - sacc(omys), simple console gopher client
git clone git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/sacc/
Log
Files
Refs
Tags
LICENSE
---
commit 641ce728054743d3f0475ba6c35bafb6d2bc10ac
parent cea0177aa0fa82195efa6dd16c15dcc47af5bba5
Author: Quentin Rameau 
Date:   Mon,  3 Jul 2017 00:43:12 +0200

Keep text file displayed until user hits enter

Diffstat:
  M sacc.c                              |       7 +++++--

1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/sacc.c b/sacc.c
@@ -121,7 +121,7 @@ static void
 displaytextitem(Item *item)
 {
         FILE *pagerin;
-        int pid, wpid;
+        int pid, wpid, status;
 
         uicleanup();
         switch (pid = fork()) {
@@ -131,7 +131,10 @@ displaytextitem(Item *item)
         case 0:
                 pagerin = popen("$PAGER", "we");
                 fputs(item->raw, pagerin);
-                exit(pclose(pagerin));
+                status = pclose(pagerin);
+                fputs("[ Press Enter to continue ]", stdout);
+                getchar();
+                exit(status);
         default:
                 while ((wpid = wait(NULL)) >= 0 && wpid != pid)
                         ;