Seems to work as well.

I ran the script against usb-modeswitch-data-20170205 and don't see wrong 
indices.

On 05/24/2017 11:38 AM, Felix Fietkau wrote:
> On 2017-05-18 15:18, Julian Labus wrote:
>> the way how the script checked if a key already exists in a hash
>> leads to wrong indices for %messages.
>>
>> Signed-off-by: Julian Labus <jul...@labus-online.de>
> The patch looks a bit convoluted. How about this instead?
> 
> --- a/convert-modeswitch.pl
> +++ b/convert-modeswitch.pl
> @@ -9,7 +9,7 @@ sub add_message {
>       my $msg = shift;
>       my $val = $messages{$msg};
>  
> -     $val or do {
> +     defined($val) or do {
>               $val = $msg_ctr++;
>               $messages{$msg} = $val;
>       };

_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to