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