RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Pinto Elia Root: /v/rpm/cvs Email: devzero2...@rpm5.org Module: popt Date: 21-Jun-2010 17:13:49 Branch: HEAD Handle: 2010062115134900 Modified files: popt CHANGES popt.c Log: Fix: do make check work again. And yes the style is certainly not perfect. Summary: Revision Changes Path 1.139 +1 -0 popt/CHANGES 1.151 +6 -4 popt/popt.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: popt/CHANGES ============================================================================ $ cvs diff -u -r1.138 -r1.139 CHANGES --- popt/CHANGES 18 Jun 2010 18:59:20 -0000 1.138 +++ popt/CHANGES 21 Jun 2010 15:13:49 -0000 1.139 @@ -1,4 +1,5 @@ 1.17 -> 2.0: + - devzero2000: fix: make check work again - jbj: remove llvm warning from s/int/size_t/. - jbj: bump version to 1.17.DEVEL. - jbj: tests: test-cases for UNWANTEDARGS (Wayne Davison<way...@samba.org>). @@ . patch -p0 <<'@@ .' Index: popt/popt.c ============================================================================ $ cvs diff -u -r1.150 -r1.151 popt.c --- popt/popt.c 18 Jun 2010 18:59:20 -0000 1.150 +++ popt/popt.c 21 Jun 2010 15:13:49 -0000 1.151 @@ -1796,27 +1796,29 @@ { poptItem * items, item; size_t * nitems; + int * naliases; switch (flags) { case 1: items = &con->execs; nitems = &con->numExecs; + *items = xrealloc((*items), ((*nitems) + 1) * sizeof(**items)); break; case 0: items = &con->aliases; - nitems = &con->numAliases; + naliases = &con->numAliases; + *items = xrealloc((*items), ((*naliases) + 1) * sizeof(**items)); break; default: return 1; /*...@notreached@*/ break; } - *items = xrealloc((*items), ((*nitems) + 1) * sizeof(**items)); assert(*items); /* XXX can't happen */ if ((*items) == NULL) return 1; - item = (*items) + (*nitems); + item =(flags ? (*items) + (*nitems) : (*items) + (*naliases) ); item->option.longName = (newItem->option.longName ? xstrdup(newItem->option.longName) : NULL); @@ -1831,7 +1833,7 @@ item->argc = newItem->argc; item->argv = newItem->argv; - (*nitems)++; + (flags ? (*nitems)++ : (*naliases)++ ); return 0; } @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org