diff -Naur gpm-1.19.6.old/doc/Makefile.in gpm-1.19.6/doc/Makefile.in
--- gpm-1.19.6.old/doc/Makefile.in	2001-10-03 22:51:46.000000000 +0200
+++ gpm-1.19.6/doc/Makefile.in	2004-08-15 19:29:16.000000000 +0200
@@ -71,7 +71,7 @@
 all: $(srcdir)/gpmdoc.ps $(srcdir)/gpm.info $(srcdir)/gpmdoc.txt $(MANPAGES)
 
 $(MANPAGES): doc.gpm manpager
-	gawk -f ./manpager doc.gpm
+	$(AWK) -f ./manpager doc.gpm
 
 # why gpmdoc.ps and gpm.ps
 gpmdoc.ps:	gpm.ps
diff -Naur gpm-1.19.6.old/doc/manpager gpm-1.19.6/doc/manpager
--- gpm-1.19.6.old/doc/manpager	2001-09-23 21:00:03.000000000 +0200
+++ gpm-1.19.6/doc/manpager	2004-08-15 19:36:49.000000000 +0200
@@ -1,11 +1,20 @@
-#! /usr/bin/gawk -f
+#! /usr/bin/awk -f
 
-# Warning: this uses gnu-awk features
+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}
@@ -23,47 +32,27 @@
 
 	        { gsub("^%M ?",""); }
 
-# itz Wed Sep 30 10:28:58 PDT 1998
-/@b\{/ {
-  $0 = gensub(/@b\{([^}]+)\}/, "\\\\fB\\1\\\\fP","g");
-} 
-
-/@(samp|code|file)\{/ {
-  $0 = gensub(/@(samp|code|file)\{([^}]+)\}/, "`\\2'","g");
-}
-
-/@var\{/ {
-  $0 = gensub(/@var\{([^}]+)\}/, "\\\\fI\\1\\\\fP","g");
-} 
+/@b\{/		{eat("b", "\\fB", "\\fP")} 
+/@samp\{/	{eat("samp", "`", "'")}
+/@code\{/	{eat("code", "`", "'")}
+/@file\{/	{eat("file", "`", "'")}
+/@var\{/	{eat("var", "\\fI", "\\fP")}
 
-/@xref\{.*\}\./ {
-  gsub(/@xref\{.*\}\./,"");
-}
+/@xref\{.*\}\./	{gsub(/@xref\{.*\}\./,"")}
 
-/@ref\{.*\}/ {
-  gsub("@ref\{","");
-  gsub("\}","");
-}
+/@ref\{.*\}/	{gsub("@ref{",""); gsub("}","")}
 
-/@\*/ {
-  gsub(/@\* */,"\n.br\n");
-}
+/@\*/		{gsub(/@\* */,"\n.br\n")}
 
-/@[a-z]+\{/      {
-                gsub("@[a-z]+\\{","");
-		gsub("}","");
-		}
-
-/^@table/       { TABLE=1; }
+/@[a-z]+\{/	{gsub("@[a-z]+\\{",""); gsub("}","")}
 
 /^@item/        {
 	        gsub("^@item *","");
+		NEEDLP=0;
 		printf ".TP\n%s\n",$0 > NAME;
-		NEEDLP=0; next;
+		next;
 		}
 
-/^@end table/   {TABLE=0}
-
 # discard other texinfo commands
 
 /^@/		{next}
@@ -72,34 +61,27 @@
 
 /^%/		{next}
 
-
-		{
-		gsub("[^\\\\]%.*$","");
-		gsub("\\%","%");
-		}
+		{gsub("[^\\\\]%.*$",""); gsub("\\%","%")}
 
 # remove leading blanks
 
-/^[ \t]/	{gsub("^[ \t]*","");}
+/^[ \t]/	{sub("^[ \t]*","")}
 
 # put a .LP at blank lines
 
 /^.nf/          {USELP=0}
 /^.fi/          {USELP=1}
 
-/^$/	        {if (USELP) {NEEDLP++; next;} }
+/^$/	        {if (USELP) {NEEDLP++; next}}
 
-
-/./	        { if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0; } }
+/./	        {if (NEEDLP) { printf "\n.LP\n" > NAME; NEEDLP=0}}
 
 /^.TH/	        {USELP=1}
 
 # Escape single slashes (e.g. in documentation for `-l' command line option)
 
-		{gsub("\\\\ ", "\\\\ ");}
+		{gsub("\\\\ ", "\\\\&")}
 
-                {gsub("~", "~~");}
+                {gsub("~", "~~")}
 
 	        {print > NAME}
-
-
diff -Naur gpm-1.19.6.old/doc/mktxt gpm-1.19.6/doc/mktxt
--- gpm-1.19.6.old/doc/mktxt	2001-09-23 21:00:03.000000000 +0200
+++ gpm-1.19.6/doc/mktxt	2004-08-15 19:38:00.000000000 +0200
@@ -1,6 +1,4 @@
-#! /usr/bin/gawk -f
-
-# Warning: this may use gnu-awk features
+#! /usr/bin/awk -f
 
 # Program to create ascii from info;
 # Missing: table of contents
@@ -29,7 +27,7 @@
 NODELINE==5  { printf "\t\t\t\t"; NODELINE=0}
 
 
-/^* Menu:$/  { KEEP=0 }
+/^.* Menu:$/  { KEEP=0 }
 
 
 
