enable use of vis, copying code in from OpenBSD CVS
[debian/pax] / gen_subs.c
index 07c9e96b26db9c73c573433d11c70957a8dc979d..6a3184d93eed799643ad8d47e74cc6bef4059c7e 100644 (file)
@@ -54,7 +54,9 @@ static const char rcsid[] = "$OpenBSD: gen_subs.c,v 1.19 2007/04/04 21:55:10 mil
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
-#include <vis.h>
+#ifndef DEBIAN
+# include <vis.h>
+#endif /* DEBIAN */
 #include "pax.h"
 #include "extern.h"
 
@@ -69,6 +71,9 @@ static const char rcsid[] = "$OpenBSD: gen_subs.c,v 1.19 2007/04/04 21:55:10 mil
  */
 #define MODELEN 20
 #define DATELEN 64
+#define DAYSPERNYEAR 365
+#define SECSPERDAY 86400
+/* #define VIS_CSTYLE 0 */
 #define SIXMONTHS       ((DAYSPERNYEAR / 2) * SECSPERDAY)
 #define CURFRMT                "%b %e %H:%M"
 #define OLDFRMT                "%b %e  %Y"
@@ -209,7 +214,7 @@ safe_print(const char *str, FILE *fp)
        /*
         * if printing to a tty, use vis(3) to print special characters.
         */
-       if (isatty(fileno(fp))) {
+       if (0 && isatty(fileno(fp))) {
                for (cp = str; *cp; cp++) {
                        (void)vis(visbuf, cp[0], VIS_CSTYLE, cp[1]);
                        (void)fputs(visbuf, fp);