chiark / gitweb /
0daa77be8a78a2a40409c4b830433a55575cecf9
[termux-packages] / packages / hexcurse / src-getopt.c.patch
1 diff -u -r ../hexcurse-hexcurse-1.58/src/getopt.c ./src/getopt.c
2 --- ../hexcurse-hexcurse-1.58/src/getopt.c      2014-02-26 19:26:34.000000000 -0500
3 +++ ./src/getopt.c      2015-08-23 07:53:55.917711262 -0400
4 @@ -32,16 +32,6 @@
5  #undef optind
6  #undef alloca
7  
8 -/* The following modification was submited by Claudio Fanin.  This change *
9 - * enables hexcurse to be compiled with SGI's proprietary compiler        */
10 -#ifdef _SGIAPI
11 -#include <alloca.h>
12 -#endif
13 -#ifndef __alloca
14 -#define __alloca      alloca
15 -#endif
16 -/* end of modification */
17 -
18  #ifdef HAVE_OPTIND
19  extern char* optarg;
20  #else
21 @@ -85,7 +75,7 @@
22       char **argv;
23  {
24    int nonopts_size = (last_nonopt - first_nonopt) * sizeof (char *);
25 -  char **temp = (char **) __alloca (nonopts_size);
26 +  char **temp = (char **) malloc(nonopts_size);
27  
28    /* Interchange the two blocks of data in ARGV.  */
29  
30 @@ -95,6 +85,7 @@
31    my_bcopy ((char *) temp,
32             (char *) &argv[first_nonopt + optind - last_nonopt],
33             nonopts_size);
34 +  free(temp);
35  
36    /* Update records for the slots the non-options now occupy.  */
37