diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-09-15 15:56:25 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-09-15 15:56:25 -0700 |
commit | df4c0b0f7b27b31010eaf82bacec32831a020e76 (patch) | |
tree | 84a11ddc0233eb4edac84a6c981448a79943ddc3 /man2html/strdefs.c | |
parent | 5fbc5eae2872b0258ee247a2b7f5a115d9e8e13b (diff) | |
download | man-df4c0b0f7b27b31010eaf82bacec32831a020e76.tar.gz man-df4c0b0f7b27b31010eaf82bacec32831a020e76.tar.bz2 man-df4c0b0f7b27b31010eaf82bacec32831a020e76.zip |
Implement \n[.$] variable properly.
Make .$ correspond to the number of arguments in the macro call.
Diffstat (limited to 'man2html/strdefs.c')
-rw-r--r-- | man2html/strdefs.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/man2html/strdefs.c b/man2html/strdefs.c index e97bcab..03f4012 100644 --- a/man2html/strdefs.c +++ b/man2html/strdefs.c @@ -1,3 +1,4 @@ +#include <stdlib.h> #include "defs.h" #ifndef NULL @@ -10,7 +11,7 @@ int nroff = 1; #define TROFF (-667) STRDEF *chardef, *strdef, *defdef; -INTDEF *intdef; +INTDEF *intdef, *nargdef; static INTDEF standardint[] = { { V('n',' '), NROFF, 0, NULL }, @@ -168,10 +169,15 @@ void stdinit(void) { while (intdef->nr) { if (intdef->nr == NROFF) intdef->nr = nroff; else if (intdef->nr == TROFF) intdef->nr = !nroff; + if (intdef->nr == V('.','$')) + nargdef = intdef; intdef->next = &standardint[i]; intdef = intdef->next; i++; } intdef = &standardint[0]; defdef = NULL; + + if (!nargdef) + abort(); } |