Cygwin package search and cygcheck -p urlencoding still broken on new web server

Jon Turney
Thu Jul 16 13:42:44 GMT 2020

On 16/07/2020 08:44, Marco Atzeri via Cygwin wrote:
> On 16.07.2020 06:25, Brian Inglis wrote:
>> On 2020-07-15 14:13, Marco Atzeri via Cygwin wrote:
>>> Problem: I want to search for
>>>     libssh/libssh.h
>>> Using
>>> If I put the name and press Go the URL is changed in
>>> and the output is
>>>     Found 0 matches for libsshx2Flibssh.h
>>>                               ^^^
>>> Instead if I modify directly the URL in:

I think that this is an invalid URL, that just happens to work, so it's 
correct that the link we produce is urlencoded.

(See e.g.

>>> Found 3 matches for libssh/libssh.h
>>> ....
>>> I guess that the current incapability is due to spurious urlencode in
>>> cgi-bin2/package-grep.cgi
>>> that is modifing the $param_grep
>>> echo '<li><a href="package-cat.cgi?file='`urlencode
>>> $partfile`'&grep='`urlencode $param_grep`'">'$file'</a> - 
>>> '$desc'</li>'
>>> Could someone double check my guess ?

So it seems the urlencode is correct, but the urldecode isn't working.

I've applied a one-character change which appears to fix things.

> the git logs says that only Frank and Jon have recently worked on
>     cgi-bin2/package-grep.cgi
> I would like to double check any possible modification before proposing a
> patch to change the web server...

This was actually fairly easy to reproduce locally, once I realized what 
was going on:

$ export url="libssh%2Flibssh.h" ; printf '%b' "${url//%/\x}"

$ export url="libssh%2Flibssh.h" ; printf '%b' "${ur//%/\\x}"

More information about the Cygwin mailing list