Parse user-defined macros before the global ones (closes: #5587). Index: man-1.6g/man2html/man2html.c =================================================================== --- man-1.6g.orig/man2html/man2html.c 2011-01-09 11:20:58.000000000 +0100 +++ man-1.6g/man2html/man2html.c 2011-01-09 11:21:22.000000000 +0100 @@ -1697,7 +1697,42 @@ c = scan_escape(c+1); } else { i=V(c[0],c[1]); - switch (i) { + /* search macro database of self-defined macros */ + owndef = find_longstrdef(defdef, i, c, NULL); + if (owndef) { + char **oldargument; + int deflen; + int onff; + sl=fill_words(c+strlen(owndef->longname), wordlist, SIZE(wordlist), &words, '\n'); + c=sl+1; + *sl=0; + for (i=1; ist); + owndef->st[deflen+1]='a'; + for (i=0; (owndef->st[deflen+2+i] = owndef->st[i]); i++); + oldargument=argument; + argument=wordlist; + onff=newline_for_fun; + if (mandoc_command) + scan_troff_mandoc(owndef->st+deflen+2, 0, NULL); + else + scan_troff(owndef->st+deflen+2, 0, NULL); + newline_for_fun=onff; + argument=oldargument; + for (i=0; ilongname), wordlist, SIZE(wordlist), &words, '\n'); - c=sl+1; - *sl=0; - for (i=1; ist); - owndef->st[deflen+1]='a'; - for (i=0; (owndef->st[deflen+2+i] = owndef->st[i]); i++); - oldargument=argument; - argument=wordlist; - onff=newline_for_fun; - if (mandoc_command) - scan_troff_mandoc(owndef->st+deflen+2, 0, NULL); - else - scan_troff(owndef->st+deflen+2, 0, NULL); - newline_for_fun=onff; - argument=oldargument; - for (i=0; i