[LEDE-DEV] [PATCH usbmode] fix indices of messages

Julian Labus julian at labus-online.de
Wed May 24 02:55:04 PDT 2017


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 <julian at 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;
>  	};



More information about the Lede-dev mailing list