repo: uritools
action: commit
revision: 
path_from: 
revision_from: e37893cabfe8bb251a1c2978f902623ca5ace7d5:
path_to: 
revision_to: 
git.thebackupbox.net
uritools
git clone git://git.thebackupbox.net/uritools
commit e37893cabfe8bb251a1c2978f902623ca5ace7d5
Author: epoch 
Date:   Tue Mar 16 12:46:13 2021 -0500

    /something/ causes uriunescape to mess up when the output buffer is the same as the input buffer.

diff --git a/uriunescape.c b/uriunescape.c
index c99cdfc1a812e967258b76563b203a26ea7adc45..
index ..23800a5e6eb2ad09aa193cb9a22526f8d9468237 100644
--- a/uriunescape.c
+++ b/uriunescape.c
@@ -9,12 +9,14 @@ int main(int argc,char *argv[]) {
   int len;
   char buf[BUFSIZE];
   char buf2[BUFSIZE];
+  char *ab;
   int blen;
   int hack;
   if(argc > 1) {
     for(argv++,argc--;argc;argc--,argv++) {
-      len=uriunescape(*argv,*argv);
-      write(1,*argv,len);
+      ab=malloc(strlen(*argv));
+      len=uriunescape(*argv,ab);
+      write(1,ab,len);
       if(argc-1) write(1," ",1);
     }
   } else {

-----END OF PAGE-----