You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-cvs@tcl.apache.org by da...@apache.org on 2001/12/28 17:32:39 UTC

cvs commit: tcl-websh/src/generic uricode.c

davidw      01/12/28 08:32:39

  Modified:    src/generic uricode.c
  Log:
  * generic/uricode.c (uriDecode): Fixed comparisons to work with 'char
    *' instead of specifying signed/unsigned.
  
  Revision  Changes    Path
  1.4       +6 -4      tcl-websh/src/generic/uricode.c
  
  Index: uricode.c
  ===================================================================
  RCS file: /home/cvs/tcl-websh/src/generic/uricode.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- uricode.c	2001/11/07 12:57:01	1.3
  +++ uricode.c	2001/12/28 16:32:39	1.4
  @@ -3,11 +3,12 @@
    *
    * (c) 1996-20009 netcetera AG (simon.hefti@netcetera.ch)
    *
  - * @(#) $Id: uricode.c,v 1.3 2001/11/07 12:57:01 davidw Exp $
  + * @(#) $Id: uricode.c,v 1.4 2001/12/28 16:32:39 davidw Exp $
    *
    */
   
   #include <tcl.h>
  +#include <limits.h>
   #include "web.h"
   #include "stdlib.h"		/* strtol() */
   #include "conv.h"
  @@ -138,7 +139,7 @@
   
       int length;
       Tcl_Obj *res = NULL;
  -    signed char *utf = NULL;
  +    char *utf = NULL;
       Tcl_UniChar unic;
       char buf[3];
   
  @@ -157,13 +158,14 @@
   	case '%':
   	    utf = Tcl_UtfNext(utf);
   
  -	    if (utf[0] > 0) {
   
  +	    if (utf[0] > 0 && utf[0] < 128) {
  +
   		/* case: %[7bit] */
   		buf[0] = utf[0];
   
   		utf = Tcl_UtfNext(utf);
  -		if (utf[0] > 0) {
  +		if (utf[0] > 0 && utf[0] < 128) {
   
   		    /* case: %[7bit][7bit] */
   		    buf[1] = utf[0];