#include "uri.h" #include #include int main(int argc,char *argv[]) { int i; int len; char doh[2]; int hack=0; char buf[16]; char buf2[16]; if(argc > 1) { for(argv++,argc--;argc;argc--,argv++) { len=uriunescape(*argv,*argv); write(1,*argv,len); if(argc-1) write(1," ",1); } } else { while(fgets(buf+hack,sizeof(buf)-1-hack,stdin)) {//this is a bad idea. first chunk could end inside of a sequence we could decode. [first %] [09 second] hack=0; for(i=0;i<2;i++) {//2 being max length of a %XX thing. if(buf[strlen(buf)-1-i] == '%') { for(j=0;j