Substitute `%25' and `&' in page_{prev,next} URLs - gophercgis - Collection of gopher CGI/DCGI for geomyidae
 (HTM) hg clone https://bitbucket.org/iamleot/gophercgis
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) changeset 5942ee61daeed3f7fff2d02f550c4185b8d139fe
 (DIR) parent 5a5fdbdf0980d38546123a44612e3b70b261e2eb
 (HTM) Author: Leonardo Taccari <iamleot@gmail.com>
       Date:   Sun, 16 Sep 2018 18:23:53 
       
       Substitute `%25' and `&amp;' in page_{prev,next} URLs
       
       This is actually a non-functional change because it seems that
       YouTube ignore that but it is actually different to pass `%25' and
       `&amp;' in URLs instead of `%' and `&'. sub()stitute accordingly
       in order to do the latter like browsers.
       
       Diffstat:
        youtube/search.dcgi |  4 ++++
        1 files changed, 4 insertions(+), 0 deletions(-)
       ---
       diff -r 5a5fdbdf0980 -r 5942ee61daee youtube/search.dcgi
       --- a/youtube/search.dcgi       Sun Sep 16 02:03:47 2018 +0200
       +++ b/youtube/search.dcgi       Sun Sep 16 18:23:53 2018 +0200
       @@ -60,6 +60,8 @@
               }
        
               page_prev = substr($0, RSTART + 6, RLENGTH - 7)
       +       sub("%25", "%", page_prev)
       +       sub("&amp;", "\\&", page_prev)
               printf("\n")
               printf("[1|<< Previous|'"${SEARCH_CGI}"'?%s|server|port]\n", page_prev)
        }
       @@ -70,6 +72,8 @@
               }
        
               page_next = substr($0, RSTART + 6, RLENGTH - 7)
       +       sub("%25", "%", page_next)
       +       sub("&amp;", "\\&", page_next)
               if (!page_prev) {
                       printf("\n")
               }