Description Fixes to awk manpages script

Index: b/doc/manpager
===================================================================
--- a/doc/manpager	2007-12-10 08:25:18.000000000 +0200
+++ b/doc/manpager	2007-12-10 08:25:38.000000000 +0200
@@ -1,10 +1,21 @@
 #! /usr/bin/awk -f
 # Copyright (c) 1998-2001 Alessandro Rubini
 
+function eat(pat, start, stop)
+{
+	N = split($0, arr, "@"pat"{");
+	res = arr[1];
+	for (i = 2; i <= N; i++) {
+		sub("}", stop, arr[i]);
+		res = res start arr[i];
+	}
+	$0 = res;
+}
+
 BEGIN {IN=0}
 
 /^%MANPAGE END/ {IN=0; next}
-/^%MANPAGE/     {IN=1; USELP=NEEDLP=INTABLE=0; NAME=$2; next}
+/^%MANPAGE/     {IN=1; USELP=NEEDLP=0; NAME=$2; next}
 IN==0           {next}
 
 /^%MSKIP/	{SKIP=1;next}
@@ -22,32 +33,13 @@ SKIP==1         {next}
 
 	        { gsub("^%M ?",""); }
 
-# Use gensub for converting tags: itz Sep 30 1998
+# Use eat for converting tags
 #
-# However, the gensub function is gawk-specific, and we want things
-# to work with original-awk too (for portability).
-# Therefore, use a normal gsub, even though it's a subobptimal solution
-# as it may step in extra braces. The good solution will be piping to sed,
-# or match, extract subesxpression, replace, reinsert -- bleah...
-# (ARub, Oct 10 2000)
-/@b\{/ {
-  #$0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g");
-  gsub("@b\{","\\fB");
-  gsub("\}","\\fP");
-} 
-
-/@var\{/ {
-  #$0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g");
-  gsub("@var\{","\\fB");
-  gsub("\}","\\fP");
-} 
-
-/@(samp|code|file)\{/ {
-  #$0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g");
-  gsub("@(samp|code|file)\{","");
-  gsub("\}","");
-}
-
+/@b\{/		{eat("b", "\\fB", "\\fP")}
+/@samp\{/	{eat("samp", "`", "'")}
+/@code\{/	{eat("code", "`", "'")}
+/@file\{/	{eat("file", "`", "'")}
+/@var\{/	{eat("var", "\\fI", "\\fP")}
 
 /@xref\{.*\}\./ {
   gsub(/@xref\{.*\}\./,"");
@@ -96,7 +88,7 @@ SKIP==1         {next}
 
 # remove leading blanks
 
-/^[ \t]/        {gsub("^[ \t]","");}
+/^[ \t]/	{sub("^[ \t]*","")}
 
 # put a .LP at blank lines
 
@@ -112,7 +104,7 @@ SKIP==1         {next}
 
 # Escape single slashes (e.g. in documentation for `-l' command line option)
 
-		{gsub("\\\\ ", "\\\\ ");}
+		{gsub("\\\\ ", "\\\\&");}
 
                 {gsub("~", "~~");}
 
