summaryrefslogtreecommitdiff
path: root/devel/pardiff/patches/patch-aa
blob: 681025ca95507e2abea859419f85af44a8346005 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$NetBSD: patch-aa,v 1.2 2001/07/09 17:17:04 zuntum Exp $

--- pardiff/pardiff.c.orig	Sat Jul  7 07:54:35 2001
+++ pardiff/pardiff.c
@@ -23,7 +23,11 @@
 
 /* include files to determine the width of the output terminal */
 #include <fcntl.h>
+#if defined __NetBSD__ || defined __FreeBSD__ || defined __OpenBSD__
+#include <sys/ttycom.h>
+#else
 #include <termio.h>
+#endif
 
 
 #else
@@ -314,7 +318,11 @@
          * Preprocess lines to get a consistent EOL
          */
         if (convertCrlf) {
+#if defined __NetBSD__ || defined __FreeBSD__ || defined __OpenBSD__
+            line_len = strlen(nextline);
+#else
             line_len = strnlen(nextline, PARDIFF_LINE_BUF_SIZE); 
+#endif
             if (line_len > 2 && nextline[line_len - 2] == 0xd) {
                 nextline[line_len - 2] = '\n';
                 nextline[line_len - 1] = '\0';