Pushed, thanks a lot!
I adjusted slightly the patch to prepend the prefixes when there is no
'H'/'G'/'*' instead of appending, assuming such flags string would only
contain server-specific flags. (This shouldn't really happen in practice
anyways, servers are supposed to always send at least 'H' or 'G'.)
On Sun Jun 30, 2024 at 4:51 PM EST, Simon Ser wrote:
> I adjusted slightly the patch to prepend the prefixes when there is no> 'H'/'G'/'*' instead of appending
Ah of course. Nice catch, thanks!
On Sun Jun 30, 2024 at 4:51 PM EST, Simon Ser wrote:
> Pushed, thanks a lot!>> I adjusted slightly the patch to prepend the prefixes when there is no> 'H'/'G'/'*' instead of appending, assuming such flags string would only> contain server-specific flags. (This shouldn't really happen in practice> anyways, servers are supposed to always send at least 'H' or 'G'.)
Actually, doesn't IndexFunc return -1 only when info.Flags contains
_only_ H/G/*? In which case appending is the right thing to do.
info.Flags = 'H' => IndexFunc returns -1 (append to info.Flags)
info.Flags = 'asdf' => IndexFunc returns 0 (insert into info.Flags)
See https://go.dev/play/p/6Qo-zjBcIho.
On Monday, July 1st, 2024 at 00:09, Gregory Anders <greg@gpanders.com> wrote:
> On Sun Jun 30, 2024 at 4:51 PM EST, Simon Ser wrote:> > > Pushed, thanks a lot!> > > > I adjusted slightly the patch to prepend the prefixes when there is no> > 'H'/'G'/'*' instead of appending, assuming such flags string would only> > contain server-specific flags. (This shouldn't really happen in practice> > anyways, servers are supposed to always send at least 'H' or 'G'.)> > Actually, doesn't IndexFunc return -1 only when info.Flags contains> only H/G/*? In which case appending is the right thing to do.
Ooops! Thanks for noticing, I shouldn't do last-minute edits late at
night!
Indeed, you're correct, and this is important to fix since it's quite
common for the WHO flags to not contain server-specific flags.
Pushed a commit to fix the mistake.