From 08aa87fb570af9ec0a88ba0d1d4eb66d0da94e03 Mon Sep 17 00:00:00 2001 From: Peter Berg Larsen Date: Mon, 3 Jan 2005 20:18:58 +0000 Subject: [PATCH] Currently a '//****' is matched as an /* comment - disallow a '/' in front of the '/*' match. An 'extern "C" {' can be split in several lines - allow '\n' as space, and lookout for the rest if partial found. --- tools/winedump/function_grep.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)