summaryrefslogtreecommitdiff
path: root/urlescape.c
diff options
context:
space:
mode:
Diffstat (limited to 'urlescape.c')
-rw-r--r--urlescape.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/urlescape.c b/urlescape.c
new file mode 100644
index 0000000..ce8e3e7
--- /dev/null
+++ b/urlescape.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+#include "url.h"
+
+int main(int argc,char *argv[]) {
+ int len;
+ char *out;
+ if(argc < 2) return 1;
+ len=urlescapelength(argv[1],strlen(argv[1]));
+ out=malloc(len+1);
+ urlescape(argv[1],out,len);
+ out[len]=0;
+ printf("%s\n",out);
+ return 0;
+}