[CVS] RPM: popt/ .splintrc CHANGES configure.ac findme.c popt.c popt.h...
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: popt Date: 09-Mar-2008 21:24:46 Branch: HEAD Handle: 2008030920244500 Modified files: popt.splintrc CHANGES configure.ac findme.c popt.c popt.h poptconfig.c poptint.c poptint.h poptparse.c system.h Log: - jbj: study the mess with splint, remove annotations where possible. - jbj: add -D_GNU_SOURCE for gcc to use __builtin_stpcpy when available. - jbj: add static inline stpcpy for the deprived. - jbj: use stpcpy to eliminate sprintf calls everywhere but popthelp.c - jbj: remove (now unneeded afaik) va_copy() from POPT_fprintf(). - jbj: inline strdup_fprintf() => POPT_fprintf keeping (unneeded?) va_copy. Summary: RevisionChanges Path 1.10+2 -4 popt/.splintrc 1.70+6 -0 popt/CHANGES 1.39+10 -33 popt/configure.ac 1.19+1 -2 popt/findme.c 1.119 +52 -55 popt/popt.c 1.67+2 -1 popt/popt.h 1.37+29 -24 popt/poptconfig.c 1.17+32 -49 popt/poptint.c 1.36+2 -1 popt/poptint.h 1.30+3 -1 popt/poptparse.c 1.14+14 -1 popt/system.h patch -p0 <<'@@ .' Index: popt/.splintrc $ cvs diff -u -r1.9 -r1.10 .splintrc --- popt/.splintrc16 Feb 2008 20:57:38 - 1.9 +++ popt/.splintrc9 Mar 2008 20:24:45 - 1.10 @@ -14,7 +14,6 @@ # --- in progress #+bounds -bufferoverflowhigh - -branchstate # --- +partial artifacts @@ -35,8 +34,7 @@ # --- not-yet at checks level -mustfree# 38 -predboolptr # 82 --usedef # 7 # --- not-yet at standard level --boolops # 127 --predboolint # 42 +-boolops # 124 +-predboolint # 53 @@ . patch -p0 <<'@@ .' Index: popt/CHANGES $ cvs diff -u -r1.69 -r1.70 CHANGES --- popt/CHANGES 9 Mar 2008 07:14:06 - 1.69 +++ popt/CHANGES 9 Mar 2008 20:24:45 - 1.70 @@ -1,4 +1,10 @@ 1.13 -> 1.14: +- jbj: study the mess with splint, remove annotations where possible. +- jbj: add -D_GNU_SOURCE for gcc to use __builtin_stpcpy when available. +- jbj: add static inline stpcpy for the deprived. +- jbj: use stpcpy to eliminate sprintf calls everywhere but popthelp.c +- jbj: remove (now unneeded afaik) va_copy() from POPT_fprintf(). +- jbj: inline strdup_fprintf() => POPT_fprintf keeping (unneeded?) va_copy. - rse: fix memcpy(3) based va_copy(3) fallbacks - jbj: fix: short option with "foo=bar" argument was mishandled. (Wayne Davison<[EMAIL PROTECTED]>). @@ . patch -p0 <<'@@ .' Index: popt/configure.ac $ cvs diff -u -r1.38 -r1.39 configure.ac --- popt/configure.ac 8 Mar 2008 17:26:30 - 1.38 +++ popt/configure.ac 9 Mar 2008 20:24:45 - 1.39 @@ -20,34 +20,13 @@ AC_PROG_INSTALL AC_PROG_LIBTOOL -if test "X$CC" = Xgcc; then -CFLAGS="-Wall -W $CFLAGS" -fi - -AC_GCC_TRADITIONAL -AC_SYS_LARGEFILE - -AC_ISC_POSIX -AM_C_PROTOTYPES -AC_CHECK_VA_COPY - -dnl XXX lose rpm libs -LIBS= -addlib() { - l=$1 - shift - case "$target" in -*-*-solaris*)LIBS="$LIBS -L$l -R $l $*";; -*) LIBS="$LIBS -L$l $*";; - esac -} - dnl dnl if CC is gcc, we can rebuild the dependencies (since the depend rule dnl requires gcc). If it's not, don't rebuild dependencies -- use what was dnl shipped with RPM. dnl if test X"$GCC" = "Xyes" ; then +CFLAGS="-Wall -W -D_GNU_SOURCE -D_REENTRANT $CFLAGS" TARGET="depend allprogs" else TARGET="everything" @@ -59,7 +38,14 @@ fi AC_SUBST(TARGET) -AC_CHECK_HEADERS(float.h glob.h libintl.h mcheck.h unistd.h langinfo.h) +AC_GCC_TRADITIONAL +AC_SYS_LARGEFILE + +AC_ISC_POSIX +AM_C_PROTOTYPES +AC_CHECK_VA_COPY + +AC_CHECK_HEADERS(float.h glob.h langinfo.h libintl.h mcheck.h unistd.h) # For some systems we know that we have ld_version scripts. # Use it then as default. @@ -80,19 +66,10 @@ [ : ] ) AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") -if test ! -f ../rpm.c -then
[CVS] RPM: popt/ CHANGES configure.ac poptint.c poptint.h
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: popt Date: 09-Mar-2008 23:53:24 Branch: HEAD Handle: 2008030922532400 Modified files: poptCHANGES configure.ac poptint.c poptint.h Log: - jbj: permit "#define POPT_fprintf fprintf" to lose the malloc'ing fprintf. - jbj: use vasprintf(3) when available (Wayne Davison<[EMAIL PROTECTED]>). Summary: RevisionChanges Path 1.71+2 -0 popt/CHANGES 1.40+1 -1 popt/configure.ac 1.18+45 -28 popt/poptint.c 1.37+27 -22 popt/poptint.h patch -p0 <<'@@ .' Index: popt/CHANGES $ cvs diff -u -r1.70 -r1.71 CHANGES --- popt/CHANGES 9 Mar 2008 20:24:45 - 1.70 +++ popt/CHANGES 9 Mar 2008 22:53:24 - 1.71 @@ -1,4 +1,6 @@ 1.13 -> 1.14: +- jbj: permit "#define POPT_fprintf fprintf" to lose the malloc'ing fprintf. +- jbj: use vasprintf(3) when available (Wayne Davison<[EMAIL PROTECTED]>). - jbj: study the mess with splint, remove annotations where possible. - jbj: add -D_GNU_SOURCE for gcc to use __builtin_stpcpy when available. - jbj: add static inline stpcpy for the deprived. @@ . patch -p0 <<'@@ .' Index: popt/configure.ac $ cvs diff -u -r1.39 -r1.40 configure.ac --- popt/configure.ac 9 Mar 2008 20:24:45 - 1.39 +++ popt/configure.ac 9 Mar 2008 22:53:24 - 1.40 @@ -69,7 +69,7 @@ AC_CHECK_FUNC(setreuid, [], [ AC_CHECK_LIB(ucb, setreuid, [if echo $LIBS | grep -- -lucb >/dev/null ;then :; else LIBS="$LIBS -lc -lucb" USEUCB=y;fi]) ]) -AC_CHECK_FUNCS(getuid geteuid iconv mtrace __secure_getenv setregid stpcpy strerror) +AC_CHECK_FUNCS(getuid geteuid iconv mtrace __secure_getenv setregid stpcpy strerror vasprintf) AM_GNU_GETTEXT([external]) @@ . patch -p0 <<'@@ .' Index: popt/poptint.c $ cvs diff -u -r1.17 -r1.18 poptint.c --- popt/poptint.c9 Mar 2008 20:24:45 - 1.17 +++ popt/poptint.c9 Mar 2008 22:53:24 - 1.18 @@ -16,6 +16,33 @@ }; /[EMAIL PROTECTED] =charint =ignoresigns @*/ +const char * +POPT_prev_char (const char *str) +{ +const char *p = str; + +while (1) { + p--; + if (((unsigned)*p & 0xc0) != (unsigned)0x80) + return p; +} +} + +const char * +POPT_next_char (const char *str) +{ +const char *p = str; + +while (*p != '\0') { + p++; + if (((unsigned)*p & 0xc0) != (unsigned)0x80) + break; +} +return p; +} + +#if !defined(POPT_fprintf) /* XXX lose all the goop ... */ + #if defined(HAVE_DCGETTEXT) && !defined(__LCLINT__) /* * Rebind a "UTF-8" codeset for popt's internal use. @@ -123,42 +150,30 @@ } #endif -const char * -POPT_prev_char (const char *str) -{ -const char *p = str; - -while (1) { - p--; - if (((unsigned)*p & 0xc0) != (unsigned)0x80) - return p; -} -} - -const char * -POPT_next_char (const char *str) -{ -const char *p = str; - -while (*p != '\0') { - p++; - if (((unsigned)*p & 0xc0) != (unsigned)0x80) - break; -} -return p; -} - int POPT_fprintf (FILE * stream, const char * format, ...) { char * b = NULL, * ob = NULL; -size_t nb = (size_t)1; int rc; va_list ap; +#if defined(HAVE_VASPRINTF) va_start(ap, format); -while ((b = realloc(b, nb)) != NULL) { +if ((rc = vasprintf(b, format, ap)) < 0) + b = NULL; +va_end(ap); +#else +size_t nb = (size_t)1; + +/* HACK: add +1 to the realloc no. of bytes "just in case". */ +/* XXX Likely unneeded, the issues wrto vsnprintf(3) return b0rkage have + * to do with whether the final '\0' is counted (or not). The code + * below already adds +1 for the (possibly already counted) trailing NUL. + */ +while ((b = realloc(b, nb+1)) != NULL) { + va_start(ap, format); rc = vsnprintf(b, nb, format, ap); + va_end(ap); if (rc > -1) { /* glibc 2.1 */ if ((size_t)rc < nb) break; @@ -167,7 +182,7 @@ nb += (nb < (size_t)100 ? (size_t)100 : nb); ob = b; } -va_end(ap); +#endif rc = 0;
[CVS] RPM: popt/ CHANGES popt.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: popt Date: 10-Mar-2008 00:10:06 Branch: HEAD Handle: 2008030923100500 Modified files: poptCHANGES popt.c Log: - jbj: enable equal after short option (Wayne Davison<[EMAIL PROTECTED]>). Summary: RevisionChanges Path 1.72+1 -0 popt/CHANGES 1.120 +0 -3 popt/popt.c patch -p0 <<'@@ .' Index: popt/CHANGES $ cvs diff -u -r1.71 -r1.72 CHANGES --- popt/CHANGES 9 Mar 2008 22:53:24 - 1.71 +++ popt/CHANGES 9 Mar 2008 23:10:05 - 1.72 @@ -1,4 +1,5 @@ 1.13 -> 1.14: +- jbj: enable equal after short option (Wayne Davison<[EMAIL PROTECTED]>). - jbj: permit "#define POPT_fprintf fprintf" to lose the malloc'ing fprintf. - jbj: use vasprintf(3) when available (Wayne Davison<[EMAIL PROTECTED]>). - jbj: study the mess with splint, remove annotations where possible. @@ . patch -p0 <<'@@ .' Index: popt/popt.c $ cvs diff -u -r1.119 -r1.120 popt.c --- popt/popt.c 9 Mar 2008 20:24:45 - 1.119 +++ popt/popt.c 9 Mar 2008 23:10:05 - 1.120 @@ -932,10 +932,7 @@ origOptString++; if (*origOptString != '\0') - con->os->nextCharArg = origOptString; -#ifdef NOTYET /* XXX causes test 9 failure. */ con->os->nextCharArg = origOptString + (*origOptString == '='); -#endif } if (opt == NULL) return POPT_ERROR_BADOPT; /* XXX can't happen */ @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: popt/ poptint.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: popt Date: 10-Mar-2008 05:06:23 Branch: HEAD Handle: 2008031004062300 Modified files: poptpoptint.c Log: - jbj: fix: typ, vasprintf needs an ampersand. Thanks Wayne! Summary: RevisionChanges Path 1.19+1 -1 popt/poptint.c patch -p0 <<'@@ .' Index: popt/poptint.c $ cvs diff -u -r1.18 -r1.19 poptint.c --- popt/poptint.c9 Mar 2008 22:53:24 - 1.18 +++ popt/poptint.c10 Mar 2008 04:06:23 - 1.19 @@ -159,7 +159,7 @@ #if defined(HAVE_VASPRINTF) va_start(ap, format); -if ((rc = vasprintf(b, format, ap)) < 0) +if ((rc = vasprintf(&b, format, ap)) < 0) b = NULL; va_end(ap); #else @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: popt/ testit.sh
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: popt Date: 10-Mar-2008 05:08:43 Branch: HEAD Handle: 2008031004084300 Modified files: popttestit.sh Log: - jbj: enable tests for -c=foo short options. Thanks Wayne! Summary: RevisionChanges Path 1.25+2 -2 popt/testit.sh patch -p0 <<'@@ .' Index: popt/testit.sh $ cvs diff -u -r1.24 -r1.25 testit.sh --- popt/testit.sh8 Mar 2008 23:11:56 - 1.24 +++ popt/testit.sh10 Mar 2008 04:08:43 - 1.25 @@ -101,8 +101,8 @@ run test1 "test1 - 46" "arg1: 0 arg2: (none) oStr: ping rest: pong" --optional ping pong run test1 "test1 - 47" "arg1: 0 arg2: (none) aArgv: A B rest: C" --argv A --argv B C -#run test1 "test1 - 48" "arg1: 0 arg2: foo=bar" -2foo=bar -#run test1 "test1 - 49" "arg1: 0 arg2: foo=bar" -2=foo=bar +run test1 "test1 - 48" "arg1: 0 arg2: foo=bar" -2foo=bar +run test1 "test1 - 49" "arg1: 0 arg2: foo=bar" -2=foo=bar #run_diff test3 "test3 - 51" test3-data/01.input test3-data/01.answer #run_diff test3 "test3 - 52" test3-data/02.input test3-data/02.answer @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org