/* -*-c-*-
*
- * $Id: url.c,v 1.1 1999/06/01 09:49:48 mdw Exp $
+ * $Id: url.c,v 1.5 2004/04/08 01:36:13 mdw Exp $
*
* Parsing and construction of url-encoded name/value pairs
*
* MA 02111-1307, USA.
*/
-/*----- Revision history --------------------------------------------------*
- *
- * $Log: url.c,v $
- * Revision 1.1 1999/06/01 09:49:48 mdw
- * New files for url-encoding and decoding.
- *
- */
-
/*----- Header files ------------------------------------------------------*/
+#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
DPUTC(d, '+');
break;
default:
- if (*p >= 33 && *p < 127)
+ if (isalnum((unsigned char)*p))
DPUTC(d, *p);
else
- case '&':
- case '+':
- case '=':
- case '%':
- dstr_putf(d, "%%%02x", *p);
+ dstr_putf(d, "%%%02x", *p);
break;
}
p++;