OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.1 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../netkit-ftp/fedora_arg_max.patch
  5. # Copyright (C) 2009 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. diff -up netkit-ftp-0.17/ftp/glob.c.arg_max netkit-ftp-0.17/ftp/glob.c
  17. --- netkit-ftp-0.17/ftp/glob.c.arg_max 2008-04-07 11:41:14.000000000 +0200
  18. +++ netkit-ftp-0.17/ftp/glob.c 2008-04-07 12:01:53.000000000 +0200
  19. @@ -50,6 +50,7 @@ char glob_rcsid[] =
  20. #include <stdio.h>
  21. #include <stdlib.h>
  22. #include <string.h>
  23. +#include <unistd.h>
  24. #include "ftp_var.h" /* for protos only */
  25. #include "glob.h"
  26. @@ -57,7 +58,7 @@ char glob_rcsid[] =
  27. #define QUOTE 0200
  28. #define TRIM 0177
  29. #define eq(a,b) (strcmp(a, b)==0)
  30. -#define GAVSIZ (ARG_MAX/6)
  31. +#define GAVSIZ (sysconf(_SC_ARG_MAX)/6)
  32. #define isdir(d) ((d.st_mode & S_IFMT) == S_IFDIR)
  33. const char *globerr;
  34. @@ -115,7 +116,7 @@ char **
  35. ftpglob(const char *v)
  36. {
  37. char agpath[BUFSIZ];
  38. - entry agargv[GAVSIZ];
  39. + entry *agargv;
  40. centry vv[2];
  41. vv[0].text = v;
  42. vv[1].text = NULL;
  43. @@ -133,6 +134,8 @@ ftpglob(const char *v)
  44. /* added ()'s to sizeof, (ambigious math for the compiler) */
  45. lastgpathp = agpath + (sizeof(agpath)- 2);
  46. + agargv = (entry *)malloc(sizeof (entry) * GAVSIZ);
  47. + if (agargv == NULL) fatal("Out of memory");
  48. ginit(agargv);
  49. globcnt = 0;
  50. collect(v);
  51. @@ -156,7 +159,7 @@ ginit(entry *agargv)
  52. gargv = agargv;
  53. sortbas = agargv;
  54. gargc = 0;
  55. - gnleft = ARG_MAX - 4;
  56. + gnleft = sysconf(_SC_ARG_MAX) - 4;
  57. }
  58. static
  59. @@ -674,6 +677,7 @@ efree(entry *av)
  60. {
  61. int i;
  62. for (i=0; av[i].text; i++) free(av[i].text);
  63. + free((void *)av);
  64. }
  65. static