chiark / gitweb /
libuv: Update from 1.20.0 to 1.20.1
[termux-packages] / packages / libpopt / fix-hardcoded-paths.patch
1 diff -uNr popt-1.16/poptconfig.c popt-1.16.mod/poptconfig.c
2 --- popt-1.16/poptconfig.c      2009-05-20 16:18:07.000000000 +0300
3 +++ popt-1.16.mod/poptconfig.c  2017-09-12 12:08:55.442990190 +0300
4 @@ -499,7 +499,7 @@
5  int poptReadDefaultConfig(poptContext con, /*@unused@*/ UNUSED(int useEnv))
6  {
7      static const char _popt_sysconfdir[] = POPT_SYSCONFDIR "/popt";
8 -    static const char _popt_etc[] = "/etc/popt";
9 +    static const char _popt_etc[] = "@TERMUX_PREFIX@/etc/popt";
10      char * home;
11      struct stat sb;
12      int rc = 0;                /* assume success */
13 @@ -515,12 +515,12 @@
14      if (rc) goto exit;
15  
16  #if defined(HAVE_GLOB_H)
17 -    if (!stat("/etc/popt.d", &sb) && S_ISDIR(sb.st_mode)) {
18 +    if (!stat("@TERMUX_PREFIX@/etc/popt.d", &sb) && S_ISDIR(sb.st_mode)) {
19         const char ** av = NULL;
20         int ac = 0;
21         int i;
22  
23 -       if ((rc = poptGlob(con, "/etc/popt.d/*", &ac, &av)) == 0) {
24 +       if ((rc = poptGlob(con, "@TERMUX_PREFIX@/etc/popt.d/*", &ac, &av)) == 0) {
25             for (i = 0; rc == 0 && i < ac; i++) {
26                 const char * fn = av[i];
27                 if (fn == NULL || strstr(fn, ".rpmnew") || strstr(fn, ".rpmsave"))