- Implemented GetEnhMetaFilePaletteEntries
[wine.git] / programs / regapi / regFixer.pl
blob11a98a03f181af9c2e373045fa27033aad4db76d
1 #!/usr/bin/perl
3 # This script takes as STDIN an output from the Registry
4 # (export from regedit.exe) and prefixes every subkey-value
5 # pair by their hkey,key data member
7 # Copyright 1999 Sylvain St-Germain
8 #
10 ${prefix} = "";
11 ${line} = "";
13 LINE: while(<>) {
14 chomp; # Get rid of 0x0a
16 next LINE if(/^$/); # This is an empty line
18 if( /^\[/ ) {
19 ${prefix} = ${_}; # assign the prefix for the forthcomming section
20 next LINE;
22 s/\\\\/\\/g; # Still some more substitutions... To fix paths...
24 s/^ //; # Get rid of the stupid two spaces at the begining
25 # they are there in the case of a multi-line thing
27 if (/\\$/) { # The line ends with '\', it means it is a multi
28 s/\\$//; # line thing, remove it.
30 ${line} = "${line}${_}";# Add the current line to the line to output
31 next LINE; # process the next line
34 ${line} = "${line}${_}"; # Set line to the multi line thing+the current line
36 print "${prefix}${line}\n";
37 ${line} = ""; # start over...