]> diplodocus.org Git - nmh/blobdiff - sbr/discard.c
folder_realloc.c: Move interface to own file.
[nmh] / sbr / discard.c
index a1efa4882aadc9e70297dc167a904c6f898a2f68..6591bc04aff83f7a008e5b54b7ee4aef5bd32543 100644 (file)
@@ -1,34 +1,17 @@
-
-/*
- * discard.c -- discard output on a file pointer
+/* discard.c -- discard output on a file pointer
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  * complete copyright information.
  */
 
-#include <h/mh.h>
+#include "h/mh.h"
 
 #include <termios.h>
 
-
 void
 discard (FILE *io)
 {
-    if (io == NULL)
-       return;
-
-    tcflush (fileno(io), TCOFLUSH);
-
-#if defined(_FSTDIO) || defined(__DragonFly__)
-    fpurge (io);
-#else
-# ifdef LINUX_STDIO
-    io->_IO_write_ptr = io->_IO_write_base;
-# else
-    if ((io->_ptr = io->_base))
-       io->_cnt = 0;
-# endif
-#endif
+    if (io)
+        tcflush (fileno(io), TCOFLUSH);
 }
-