diff --git a/tools/winedump/function_grep.pl b/tools/winedump/function_grep.pl index 42183cfe0b3..aa95109f816 100755 --- a/tools/winedump/function_grep.pl +++ b/tools/winedump/function_grep.pl @@ -75,7 +75,7 @@ foreach my $file (@files) { } # remove C comments - if(s/^(.*?)(\/\*.*?\*\/)(.*)$/$1 $3/s) { + if(s/^(|.*?[^\/])(\/\*.*?\*\/)(.*)$/$1 $3/s) { $again = 1; next; } elsif(/^(.*?)\/\*/s) { @@ -101,10 +101,13 @@ foreach my $file (@files) { } # Remove extern "C" - if(s/^\s*extern\s+"C"\s+\{//m) { + if(s/^\s*extern[\s\n]+"C"[\s\n]+\{//m) { $extern_c = 1; $again = 1; next; + } elsif(m/^\s*extern[\s\n]+"C"/m) { + $lookahead = 1; + next; } if($level > 0)