RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: popt/ CHANGES poptconfig.c popthelp.c poptparse.c system.h

From: Jeff Johnson <jbj@rpm5.org>
Date: Sat 03 Nov 2007 - 23:50:34 CET
Message-Id: <20071103225034.31C7934847A@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: popt                             Date:   03-Nov-2007 23:50:34
  Branch: HEAD                             Handle: 2007110322503300

  Modified files:
    popt                    CHANGES poptconfig.c popthelp.c poptparse.c
                            system.h

  Log:
    - jbj: handle Solaris signed character isspace(3) issues consistently.

  Summary:
    Revision    Changes     Path
    1.26        +2  -0      popt/CHANGES
    1.32        +7  -7      popt/poptconfig.c
    1.66        +0  -3      popt/popthelp.c
    1.26        +7  -7      popt/poptparse.c
    1.11        +3  -0      popt/system.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: popt/CHANGES
  ============================================================================
  $ cvs diff -u -r1.25 -r1.26 CHANGES
  --- popt/CHANGES	6 Oct 2007 02:14:42 -0000	1.25
  +++ popt/CHANGES	3 Nov 2007 22:50:33 -0000	1.26
  @@ -1,4 +1,6 @@
   1.12 -> 1.13:
  +    - jbj: handle Solaris signed character isspace(3) issues consistently.
  +    - bero: include <alloca.h> where necessary.
       - bero: read /etc/popt.d/* files.
       - jbj: don't read /etc/popt twice (#290531).
       - jbj: isspace(3) has i18n encoding signednesss issues on Solaris (#172393).
  @@ .
  patch -p0 <<'@@ .'
  Index: popt/poptconfig.c
  ============================================================================
  $ cvs diff -u -r1.31 -r1.32 poptconfig.c
  --- popt/poptconfig.c	6 Oct 2007 02:14:42 -0000	1.31
  +++ popt/poptconfig.c	3 Nov 2007 22:50:33 -0000	1.32
  @@ -33,20 +33,20 @@
       if (strncmp(line, con->appName, nameLength)) return;
   
       line += nameLength;
  -    if (*line == '\0' || !isspace(*line)) return;
  +    if (*line == '\0' || !_isspaceptr(line)) return;
   
  -    while (*line != '\0' && isspace(*line)) line++;
  +    while (*line != '\0' && _isspaceptr(line)) line++;
       entryType = line;
  -    while (*line == '\0' || !isspace(*line)) line++;
  +    while (*line == '\0' || !_isspaceptr(line)) line++;
       *line++ = '\0';
   
  -    while (*line != '\0' && isspace(*line)) line++;
  +    while (*line != '\0' && _isspaceptr(line)) line++;
       if (*line == '\0') return;
       opt = line;
  -    while (*line == '\0' || !isspace(*line)) line++;
  +    while (*line == '\0' || !_isspaceptr(line)) line++;
       *line++ = '\0';
   
  -    while (*line != '\0' && isspace(*line)) line++;
  +    while (*line != '\0' && _isspaceptr(line)) line++;
       if (*line == '\0') return;
   
   /*@-temptrans@*/ /* FIX: line alias is saved */
  @@ -139,7 +139,7 @@
   	  case '\n':
   	    *dst = '\0';
   	    dst = buf;
  -	    while (*dst && isspace(*dst)) dst++;
  +	    while (*dst && _isspaceptr(dst)) dst++;
   	    if (*dst && *dst != '#')
   		configLine(con, dst);
   	    chptr++;
  @@ .
  patch -p0 <<'@@ .'
  Index: popt/popthelp.c
  ============================================================================
  $ cvs diff -u -r1.65 -r1.66 popthelp.c
  --- popt/popthelp.c	3 Nov 2007 22:18:40 -0000	1.65
  +++ popt/popthelp.c	3 Nov 2007 22:50:33 -0000	1.66
  @@ -29,9 +29,6 @@
   
   /*@access poptContext@*/
   
  -/* XXX isspace(3) has i18n encoding signednesss issues on Solaris. */
  -#define	_isspaceptr(_chp)	isspace((int)(*(unsigned char *)(_chp)))
  -
   /**
    * Display arguments.
    * @param con		context
  @@ .
  patch -p0 <<'@@ .'
  Index: popt/poptparse.c
  ============================================================================
  $ cvs diff -u -r1.25 -r1.26 poptparse.c
  --- popt/poptparse.c	13 Jul 2007 12:24:00 -0000	1.25
  +++ popt/poptparse.c	3 Nov 2007 22:50:33 -0000	1.26
  @@ -86,7 +86,7 @@
   		if (*src != quote) *buf++ = '\\';
   	    }
   	    *buf++ = *src;
  -	} else if (isspace(*src)) {
  +	} else if (_isspaceptr(src)) {
   	    if (*argv[argc] != '\0') {
   		buf++, argc++;
   		if (argc == argvAlloced) {
  @@ -161,7 +161,7 @@
   	p = line;
   
   	/* loop until first non-space char or EOL */
  -	while( *p != '\0' && isspace(*p) )
  +	while( *p != '\0' && _isspaceptr(p) )
   	    p++;
   
   	linelen = strlen(p);
  @@ -175,13 +175,13 @@
   
   	q = p;
   
  -	while (*q != '\0' && (!isspace(*q)) && *q != '=')
  +	while (*q != '\0' && (!_isspaceptr(q)) && *q != '=')
   	    q++;
   
  -	if (isspace(*q)) {
  +	if (_isspaceptr(q)) {
   	    /* a space after the name, find next non space */
   	    *q++='\0';
  -	    while( *q != '\0' && isspace((int)*q) ) q++;
  +	    while( *q != '\0' && _isspaceptr(q) ) q++;
   	}
   	if (*q == '\0') {
   	    /* single command line option (ie, no name=val, just name) */
  @@ -203,14 +203,14 @@
   	*q++ = '\0';
   
   	/* find next non-space letter of value */
  -	while (*q != '\0' && isspace(*q))
  +	while (*q != '\0' && _isspaceptr(q))
   	    q++;
   	if (*q == '\0')
   	    continue;	/* XXX silently ignore missing value */
   
   	/* now, loop and strip all ending whitespace */
   	x = p + linelen;
  -	while (isspace(*--x))
  +	while (_isspaceptr(--x))
   	    *x = '\0';	/* null out last char if space (including fgets() NL) */
   
   	/* rest of line accept */
  @@ .
  patch -p0 <<'@@ .'
  Index: popt/system.h
  ============================================================================
  $ cvs diff -u -r1.10 -r1.11 system.h
  --- popt/system.h	14 Jun 2007 13:31:10 -0000	1.10
  +++ popt/system.h	3 Nov 2007 22:50:33 -0000	1.11
  @@ -17,6 +17,9 @@
   
   #include <ctype.h>
   
  +/* XXX isspace(3) has i18n encoding signednesss issues on Solaris. */
  +#define	_isspaceptr(_chp)	isspace((int)(*(unsigned char *)(_chp)))
  +
   #include <errno.h>
   #include <fcntl.h>
   #include <limits.h>
  @@ .
Received on Sat Nov 3 23:50:34 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.