Fix query path matcher

I made a blunt mistake when forgot to check for '?'

The fix should be as followed:
```c
if (*path == 0 && (*q == 0 || *q == '?'))
```