filter out comments in json files before pushing them through the JSON module
authorFelix Fietkau <nbd@openwrt.org>
Sun, 17 Feb 2013 22:35:36 +0000 (23:35 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 17 Feb 2013 22:35:36 +0000 (23:35 +0100)
data/gen-common.pm

index d9d281c..38691fb 100644 (file)
@@ -22,6 +22,7 @@ $prefix eq 'ctl_' and $ctl = 1;
 sub get_json() {
        local $/;
        my $json = <>;
 sub get_json() {
        local $/;
        my $json = <>;
+       $json =~ s/^\s*\/\/ .*$//mg;
        return decode_json($json);
 }
 
        return decode_json($json);
 }