From af75375820d36d1cca2403504d57653146d25a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sat, 24 May 2003 19:24:23 +0000 Subject: [PATCH] Tweak the function-locating regexp to handle the slightly special case of openpam_log(3) better. Also work around a mysterious Perl bug by using a loop to emulate the 'g' regexp flag. git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@228 185d5e19-27fe-0310-9dcf-9bff6b9f3609 --- misc/gendoc.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/gendoc.pl b/misc/gendoc.pl index 478af08..46ed286 100644 --- a/misc/gendoc.pl +++ b/misc/gendoc.pl @@ -32,7 +32,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $P4: //depot/projects/openpam/misc/gendoc.pl#21 $ +# $P4: //depot/projects/openpam/misc/gendoc.pl#22 $ # use strict; @@ -141,7 +141,7 @@ sub parse_source($) { $func = $fn; $func =~ s,^(?:.*/)?([^/]+)\.c$,$1,; - if ($source !~ m,\n \* ([\S ]+)\n \*/\n\n([\S ]+)\n$func\((.*?)\)\n\{,s) { + if ($source !~ m,\n \* ([\S ]+)\n \*/\n\n([\S ]+)\n_?$func\((.*?)\)\n\{,s) { warn("$fn: can't find $func\n"); return undef; } @@ -235,7 +235,7 @@ sub parse_source($) { s/\s*=(struct \w+(?: \*)?)\b\s*/\n.Vt $1\n/gs; s/\s*:([a-z_]+)\b\s*/\n.Va $1\n/gs; s/\s*;([a-z_]+)\b\s*/\n.Dv $1\n/gs; - if (s/\s*=([a-z_]+)\b\s*/\n.Xr $1 3\n/gs) { + while (s/\s*=([a-z_]+)\b\s*/\n.Xr $1 3\n/s) { ++$xref{"$1 3"}; } s/\s*\"(?=\w)/\n.Do\n/gs;