/* -*-c-*-
*
- * $Id: url.c,v 1.1 1999/06/01 09:49:48 mdw Exp $
+ * $Id: url.c,v 1.4 2001/06/22 19:36:18 mdw Exp $
*
* Parsing and construction of url-encoded name/value pairs
*
/*----- Revision history --------------------------------------------------*
*
* $Log: url.c,v $
+ * Revision 1.4 2001/06/22 19:36:18 mdw
+ * Include @<ctype.h>@.
+ *
+ * Revision 1.3 2001/01/20 12:06:21 mdw
+ * Be more conservative in base-64 encoding.
+ *
+ * Revision 1.2 1999/09/03 08:02:05 mdw
+ * Make `#' a special character which needs escaping.
+ *
* 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++;