From 4466d9ac1d3fd5f84e2ec1c1d2fc5a5430b27fb3 Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Tue, 5 Sep 2017 08:07:23 +0200 Subject: [PATCH] Fix iwla_convert.pl : skip empty key in hashs. Checks for empty lists --- tools/iwla_convert.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/iwla_convert.pl b/tools/iwla_convert.pl index 2df1928..5141818 100755 --- a/tools/iwla_convert.pl +++ b/tools/iwla_convert.pl @@ -17,6 +17,7 @@ sub dumpList { foreach $r (@list) { $r =~ s/\'/\\\'/g; + if ($first == 0) { print $FIC ", "; @@ -37,6 +38,7 @@ sub dumpHash { while( my ($k,$v) = each(%hash) ) { $k =~ s/\'/\\\'/g; $v =~ s/\'/\\\'/g; + next if ($k == "" || $v == ""); if ($first == 0) { print $FIC ", "; @@ -56,7 +58,7 @@ print $FIC "#This file was automatically generated by iwla_convert.pl. Do not ed print $FIC "robots = ["; dumpList(\@RobotsSearchIDOrder_list1, $FIC, 1); -dumpList(\@RobotsSearchIDOrder_list2, $FIC, 0); +dumpList(\@RobotsSearchIDOrder_list2, $FIC, (@RobotsSearchIDOrder_list1 == 0) ? 1 : 0); print $FIC "]\n\n"; print $FIC "search_engines = ["; @@ -65,7 +67,7 @@ print $FIC "]\n\n"; print $FIC "search_engines_2 = ["; dumpList(\@SearchEnginesSearchIDOrder_list2, $FIC, 1); -dumpList(\@Own_SearchEnginesSearchIDOrder, $FIC, 0); +dumpList(\@Own_SearchEnginesSearchIDOrder, $FIC, (@SearchEnginesSearchIDOrder_list2 == 0) ? 1 : 0); print $FIC "]\n\n"; print $FIC "not_search_engines_keys = {";