Fix GetCurrentDirectoryA and W to return the needed space for the CWD,
[wine] / programs / regapi / regFixer.pl
1 #!/usr/bin/perl
2
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
6 #
7 # Copyright 1999 Sylvain St-Germain
8
9
10 ${prefix} = "";
11 ${line}   = "";   
12
13 LINE: while(<>) {
14   chomp;                    # Get rid of 0x0a
15
16   next LINE if(/^$/);       # This is an empty line
17
18   if( /^\[/ ) {
19     ${prefix} = ${_};       # assign the prefix for the forthcomming section
20     next LINE;
21   }
22   s/\\\\/\\/g;              # Still some more substitutions... To fix paths...
23
24   s/^  //;                  # Get rid of the stupid two spaces at the begining
25                             # they are there in the case of a multi-line thing
26
27   if (/\\$/) {              # The line ends with '\', it means it is a multi
28     s/\\$//;                # line thing, remove it.
29     
30     ${line} = "${line}${_}";# Add the current line to the line to output
31     next LINE;              # process the next line
32   }
33
34   ${line} = "${line}${_}";  # Set line to the multi line thing+the current line
35
36   print "${prefix}${line}\n";  
37   ${line} = "";             # start over...
38 }
39
40
41