summaryrefslogtreecommitdiff
path: root/archivers/afio/patches/patch-ab
blob: 957e49b7624000bbedbb6a931dd421a59323c05b (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
29
30
31
32
$NetBSD: patch-ab,v 1.2 2005/10/03 11:15:55 joerg Exp $

--- compfile.c.orig	2003-06-24 21:32:20.000000000 +0000
+++ compfile.c
@@ -2,6 +2,7 @@
 
 #include <stdio.h>
 #include <errno.h>
+#include <limits.h>
 #include <unistd.h>
 #include <string.h>
 
@@ -210,7 +211,7 @@ void waitforgzip()
  * version;
  */
 
-#if ( defined(sun) && defined(__svr4__) )
+#if ( defined(__sun) && defined(__SVR4) )
 #include <dirent.h>
 #else
 #include <sys/dir.h>
@@ -283,7 +284,9 @@ compressfile (int *fdp, char *name, reg 
       tmpcomp++;
     else
       tmpcomp = name;
-#ifdef MAXNAMLEN	   /* BSD otherwise should be sysV (FFS on sysV?) */
+#if defined(NAME_MAX)
+    if (strlen (tmpcomp) + 2 > NAME_MAX)
+#elif defined(MAXNAMLEN)  /* BSD otherwise should be sysV (FFS on sysV?) */
     if (strlen (tmpcomp) + 2 > MAXNAMLEN)
 #else
     if (strlen (tmpcomp) + 2 > DIRSIZ)