asar icon indicating copy to clipboard operation
asar copied to clipboard

Warnings with name that starts with "w" can't be enabled/disabled

Open exodustx0 opened this issue 11 months ago • 2 comments

parse_warning_id_from_string() will always trim off the "w" warning prefix. I assume the idea behind this is that it's optional for the input string to have the prefix, but the effect is that warnings whose name starts with a "w" (currently only warn_command) will cause the function to return warning_id_end. This, in turn, causes an invalid_warning_id error in lib asar_patch_ex(), CLI main() and assembleblock() on warnings {en,dis}able.

I only see one solution that doesn't potentially break existing patches: do the warning name check loop without trimming the prefix, then repeat the loop once more with the prefix trim if the prefix is present.

Side-note: the invalid_warning_id error message still assumes the old behaviour of only being able to reference warnings by their ID, not their name.

exodustx0 avatar Jan 14 '25 23:01 exodustx0

You can disable it just fine, with warnings disable Wwarn_command.

I agree it's impolite to think user asked for arn_command, though.

Alcaro avatar Jan 14 '25 23:01 Alcaro

You can disable it just fine, with warnings disable Wwarn_command.

Ah, I missed that case. So there's a workaround that avoids arn_command at the very least.

exodustx0 avatar Jan 15 '25 00:01 exodustx0