3 # This script takes as STDIN an output from the regFixer.pl
4 # and reformat the file as if it would have been exported from the registry
5 # in the "REGEDIT4" format.
7 # Copyright 1999 Sylvain St-Germain
8 # Copyright 2002 Andriy Palamarchuk
10 # This library is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU Lesser General Public
12 # License as published by the Free Software Foundation; either
13 # version 2.1 of the License, or (at your option) any later version.
15 # This library is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 # Lesser General Public License for more details.
20 # You should have received a copy of the GNU Lesser General Public
21 # License along with this library; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 # I do not validate the integrity of the file, I am assuming that
29 # the input file comes from the output of regFixer.pl, therefore things
30 # should be ok, if they are not, submit a bug
40 LINE: while($s = <>) {
41 chomp($s); # get rid of new line
43 next LINE if($s =~ /^$/); # this is an empty line
45 if ($s =~ /\]$/) # only key name on the line
47 ($key) = ($s =~ /^\[(.*)\]$/);
50 die "Unrecognized string $s";
52 if ($key ne $curr_key)
60 ($key, $value) = ($s =~ /^\[(.*?)\](.+)$/);
63 die "Unrecognized string $s";
65 if ($key ne $curr_key) #curr_key might got chopped from regSet.sh