michael@428: Index: popt.c michael@428: --- popt.c.orig 2009-04-12 20:14:38.000000000 +0200 michael@428: +++ popt.c 2010-04-30 21:31:41.000000000 +0200 michael@431: @@ -519,6 +519,11 @@ michael@428: } michael@428: michael@428: if (con->leftovers != NULL && con->numLeftovers > 0) { michael@428: +#if defined(OPENPKG) michael@428: + /* Revert back to the old behaviour of passing to "exec" programs an michael@428: + extra "--" argument to clearly separate options and arguments. */ michael@428: + argv[argc++] = "--"; michael@428: +#endif michael@428: memcpy(argv + argc, con->leftovers, sizeof(*argv) * con->numLeftovers); michael@428: argc += con->numLeftovers; michael@428: } michael@431: @@ -709,10 +709,19 @@ michael@428: /*@switchbreak@*/ break; michael@428: #endif michael@428: case '!': michael@428: +#if defined(OPENPKG) michael@428: + /* allow standard "!#:+" (first argument is expanded multiple times) michael@428: + and non-standard "!#:*" (all arguments are expanded in sequence) */ michael@428: + if (!(s[0] == '#' && s[1] == ':' && (s[2] == '+' || s[2] == '*'))) michael@428: +#else michael@428: if (!(s[0] == '#' && s[1] == ':' && s[2] == '+')) michael@428: +#endif michael@428: /*@switchbreak@*/ break; michael@428: - /* XXX Make sure that findNextArg deletes only next arg. */ michael@428: +#if defined(OPENPKG) michael@428: + if (a == NULL || s[2] == '*') { michael@428: +#else michael@428: if (a == NULL) { michael@428: +#endif michael@428: if ((a = findNextArg(con, 1U, 1)) == NULL) michael@428: /*@switchbreak@*/ break; michael@428: } michael@428: Index: poptconfig.c michael@428: --- poptconfig.c.orig 2009-04-12 20:14:38.000000000 +0200 michael@428: +++ poptconfig.c 2010-04-30 21:32:23.000000000 +0200 michael@428: @@ -42,7 +42,10 @@ michael@428: /*@=declundef =exportheader =incondefs =protoparammatch =redecl =type @*/ michael@428: #endif /* __LCLINT__ */ michael@428: michael@428: -#if !defined(__GLIBC__) michael@428: +#if defined(__NetBSD__) michael@428: +#include michael@428: +#endif michael@428: +#if !defined(__GLIBC__) && (!defined(__NetBSD__) || __NetBSD_Version__ < 599001100) michael@428: /* Return nonzero if PATTERN contains any metacharacters. michael@428: Metacharacters can be quoted with backslashes if QUOTE is nonzero. */ michael@428: static int michael@428: Index: popthelp.c michael@428: --- popthelp.c.orig 2009-04-12 20:14:38.000000000 +0200 michael@428: +++ popthelp.c 2010-04-30 21:31:41.000000000 +0200 michael@428: @@ -15,7 +15,9 @@ michael@428: #include michael@428: #endif michael@428: michael@428: +#if !defined(OPENPKG) michael@428: #define POPT_WCHAR_HACK michael@428: +#endif michael@428: #ifdef POPT_WCHAR_HACK michael@428: #include /* for mbsrtowcs */ michael@428: /*@access mbstate_t @*/