hc
2023-03-21 4b55d97acc464242bcd6a8ae77b8ff37c22dec58
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
This adds ARG_MAX define to be _SC_ARG_MAX
 
Upstream-Status: Inappropriate.
Most distros have their own verion for this fix.
 
Signed-off-by: Armin Kuster <akuster808@gmail.com>
 
Index: netkit-ftp-0.17/ftp/glob.c
===================================================================
--- netkit-ftp-0.17.orig/ftp/glob.c
+++ netkit-ftp-0.17/ftp/glob.c
@@ -50,6 +50,7 @@ char glob_rcsid[] =
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 #include "ftp_var.h"  /* for protos only */
 #include "glob.h"
@@ -57,6 +58,9 @@ char glob_rcsid[] =
 #define    QUOTE 0200
 #define    TRIM 0177
 #define    eq(a,b)        (strcmp(a, b)==0)
+#ifndef ARG_MAX
+#define ARG_MAX (sysconf(_SC_ARG_MAX))
+#endif
 #define    GAVSIZ        (ARG_MAX/6)
 #define    isdir(d)    ((d.st_mode & S_IFMT) == S_IFDIR)