source:
npl/system/netkit-ftp/patches/22-netkit-ftp-0.17-arg_max.patch
@
f9ce31e
Last change on this file since f9ce31e was c5c522c, checked in by , 8 years ago | |
---|---|
|
|
File size: 1.4 KB |
-
netkit-ftp-0.17/ftp/glob.c
diff -up netkit-ftp-0.17/ftp/glob.c.arg_max netkit-ftp-0.17/ftp/glob.c
old new char glob_rcsid[] = 50 50 #include <stdio.h> 51 51 #include <stdlib.h> 52 52 #include <string.h> 53 #include <unistd.h> 53 54 54 55 #include "ftp_var.h" /* for protos only */ 55 56 #include "glob.h" … … char glob_rcsid[] = 57 58 #define QUOTE 0200 58 59 #define TRIM 0177 59 60 #define eq(a,b) (strcmp(a, b)==0) 60 #define GAVSIZ ( ARG_MAX/6)61 #define GAVSIZ (sysconf(_SC_ARG_MAX)/6) 61 62 #define isdir(d) ((d.st_mode & S_IFMT) == S_IFDIR) 62 63 63 64 const char *globerr; … … char ** 115 116 ftpglob(const char *v) 116 117 { 117 118 char agpath[BUFSIZ]; 118 entry agargv[GAVSIZ];119 entry *agargv; 119 120 centry vv[2]; 120 121 vv[0].text = v; 121 122 vv[1].text = NULL; … … ftpglob(const char *v) 133 134 /* added ()'s to sizeof, (ambigious math for the compiler) */ 134 135 lastgpathp = agpath + (sizeof(agpath)- 2); 135 136 137 agargv = (entry *)malloc(sizeof (entry) * GAVSIZ); 138 if (agargv == NULL) fatal("Out of memory"); 136 139 ginit(agargv); 137 140 globcnt = 0; 138 141 collect(v); … … ginit(entry *agargv) 156 159 gargv = agargv; 157 160 sortbas = agargv; 158 161 gargc = 0; 159 gnleft = ARG_MAX- 4;162 gnleft = sysconf(_SC_ARG_MAX) - 4; 160 163 } 161 164 162 165 static … … efree(entry *av) 674 677 { 675 678 int i; 676 679 for (i=0; av[i].text; i++) free(av[i].text); 680 free((void *)av); 677 681 } 678 682 679 683 static
Note: See TracBrowser
for help on using the repository browser.