openpkg/popt.patch

changeset 428
f880f219c566
child 431
127559aa0c5e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/openpkg/popt.patch	Tue Jul 31 12:23:42 2012 +0200
     1.3 @@ -0,0 +1,64 @@
     1.4 +Index: popt.c
     1.5 +--- popt.c.orig	2009-04-12 20:14:38.000000000 +0200
     1.6 ++++ popt.c	2010-04-30 21:31:41.000000000 +0200
     1.7 +@@ -520,6 +520,11 @@
     1.8 +     }
     1.9 + 
    1.10 +     if (con->leftovers != NULL && con->numLeftovers > 0) {
    1.11 ++#if defined(OPENPKG)
    1.12 ++	/* Revert back to the old behaviour of passing to "exec" programs an
    1.13 ++	   extra "--" argument to clearly separate options and arguments. */
    1.14 ++	argv[argc++] = "--";
    1.15 ++#endif
    1.16 + 	memcpy(argv + argc, con->leftovers, sizeof(*argv) * con->numLeftovers);
    1.17 + 	argc += con->numLeftovers;
    1.18 +     }
    1.19 +@@ -697,10 +702,19 @@
    1.20 + 	    /*@switchbreak@*/ break;
    1.21 + #endif
    1.22 + 	case '!':
    1.23 ++#if defined(OPENPKG)
    1.24 ++	    /* allow standard "!#:+" (first argument is expanded multiple times)
    1.25 ++               and non-standard "!#:*" (all arguments are expanded in sequence) */
    1.26 ++	    if (!(s[0] == '#' && s[1] == ':' && (s[2] == '+' || s[2] == '*')))
    1.27 ++#else
    1.28 + 	    if (!(s[0] == '#' && s[1] == ':' && s[2] == '+'))
    1.29 ++#endif
    1.30 + 		/*@switchbreak@*/ break;
    1.31 +-	    /* XXX Make sure that findNextArg deletes only next arg. */
    1.32 ++#if defined(OPENPKG)
    1.33 ++	    if (a == NULL || s[2] == '*') {
    1.34 ++#else
    1.35 + 	    if (a == NULL) {
    1.36 ++#endif
    1.37 + 		if ((a = findNextArg(con, 1U, 1)) == NULL)
    1.38 + 		    /*@switchbreak@*/ break;
    1.39 + 	    }
    1.40 +Index: poptconfig.c
    1.41 +--- poptconfig.c.orig	2009-04-12 20:14:38.000000000 +0200
    1.42 ++++ poptconfig.c	2010-04-30 21:32:23.000000000 +0200
    1.43 +@@ -42,7 +42,10 @@
    1.44 + /*@=declundef =exportheader =incondefs =protoparammatch =redecl =type @*/
    1.45 + #endif	/* __LCLINT__ */
    1.46 + 
    1.47 +-#if !defined(__GLIBC__)
    1.48 ++#if defined(__NetBSD__)
    1.49 ++#include <sys/param.h>
    1.50 ++#endif
    1.51 ++#if !defined(__GLIBC__) && (!defined(__NetBSD__) || __NetBSD_Version__ < 599001100)
    1.52 + /* Return nonzero if PATTERN contains any metacharacters.
    1.53 +    Metacharacters can be quoted with backslashes if QUOTE is nonzero.  */
    1.54 + static int
    1.55 +Index: popthelp.c
    1.56 +--- popthelp.c.orig	2009-04-12 20:14:38.000000000 +0200
    1.57 ++++ popthelp.c	2010-04-30 21:31:41.000000000 +0200
    1.58 +@@ -15,7 +15,9 @@
    1.59 + #include <sys/ioctl.h>
    1.60 + #endif
    1.61 + 
    1.62 ++#if !defined(OPENPKG)
    1.63 + #define	POPT_WCHAR_HACK
    1.64 ++#endif
    1.65 + #ifdef 	POPT_WCHAR_HACK
    1.66 + #include <wchar.h>			/* for mbsrtowcs */
    1.67 + /*@access mbstate_t @*/

mercurial