Index: c2man/latex.c diff -c c2man/latex.c:1.2 c2man/latex.c:1.3 *** c2man/latex.c:1.2 Sun Jan 30 15:22:15 2000 --- c2man/latex.c Sun Jan 30 15:26:22 2000 *************** *** 36,41 **** --- 36,48 ---- for (i = 0; i < NUM_TAB_SPACES; i++) putchar(' '); break; + case '\\': + if (!verbatim) { + put_string("$\\backslash$"); + } else + putchar(c); + break; + default: putchar(c); break; Index: c2man/nroff.c diff -c c2man/nroff.c:1.3 c2man/nroff.c:1.4 *** c2man/nroff.c:1.3 Sun Jan 30 15:24:36 2000 --- c2man/nroff.c Sun Jan 30 15:26:22 2000 *************** *** 10,22 **** void nroff_text(text) const char *text; { ! put_string(text); } void nroff_char(c) const int c; { ! putchar(c); } void nroff_comment() { put_string(".\\\" "); } --- 10,32 ---- void nroff_text(text) const char *text; { ! // put_string(text); ! while(*text) ! nroff_char(*text++); } void nroff_char(c) const int c; { ! switch (c) ! { ! case '\\': ! put_string("\\\\"); ! break; ! default: ! putchar(c); ! break; ! } } void nroff_comment() { put_string(".\\\" "); } *************** *** 253,262 **** if (islower(c) && state == CAPITALISE) c = toupper(c); state = TEXT; } ! ! /* escape tick at beginning of nroff output */ ! if (new_line && c == '\'') output->character('\\'); ! output->character(c); new_line = c == '\n'; } --- 263,272 ---- if (islower(c) && state == CAPITALISE) c = toupper(c); state = TEXT; } ! ! if (new_line && c == '\'') ! output->character('\\'); ! output->character(c); new_line = c == '\n'; } Index: c2man/test/README.backslash diff -c /dev/null c2man/test/README.backslash:1.1 *** /dev/null Sun Jan 30 16:12:35 2000 --- c2man/test/README.backslash Sun Jan 30 15:26:26 2000 *************** *** 0 **** --- 1,14 ---- + I used for description of some string functions the following end + character description : '\0' + + This leads to false output for latex and nroff + latex: '\0' --> '\0' + nroff: '\0' --> '\0' + + the right output would be: + latex: '\0' --> '$\backslash$0' + nroff: '\0' --> '\\0' + + I added this behaviour to the files 'nroff.c' and 'latex.c'. + For an example use backslash.h and take a look at the output + or try to do 'latex backslash.tex' with or without this patch. Index: c2man/test/backslash_test.3 diff -c /dev/null c2man/test/backslash_test.3:1.1 *** /dev/null Sun Jan 30 16:12:35 2000 --- c2man/test/backslash_test.3 Sun Jan 30 15:26:26 2000 *************** *** 0 **** --- 1,16 ---- + .\" WARNING! THIS FILE WAS GENERATED AUTOMATICALLY BY c2man! + .\" DO NOT EDIT! CHANGES MADE TO THIS FILE WILL BE LOST! + .TH "backslash_test" 3 "23 December 1999" "c2man backslash_test.h" + .SH "NAME" + backslash_test \- test the treatment of '\\0' by the tool c2man. + .SH "SYNOPSIS" + .ft B + #include + .sp + extern void backslash_test(void); + .ft R + .SH "DESCRIPTION" + Test the treatment of '\\0' by the tool c2man if you + specify latex output via the commandline '-Hl' and for the + default unix manpages. + I hope I have not added any side effects. Index: c2man/test/backslash_test.h diff -c /dev/null c2man/test/backslash_test.h:1.1 *** /dev/null Sun Jan 30 16:12:35 2000 --- c2man/test/backslash_test.h Sun Jan 30 15:26:26 2000 *************** *** 0 **** --- 1,8 ---- + /* + * test the treatment of '\0' by the tool c2man. + * test the treatment of '\0' by the tool c2man if you + * specify latex output via the commandline '-Hl' and for the + * default unix manpages. + * I hope I have not added any side effects. + */ + extern void backslash_test(); Index: c2man/test/backslash_test.tex diff -c /dev/null c2man/test/backslash_test.tex:1.1 *** /dev/null Sun Jan 30 16:12:35 2000 --- c2man/test/backslash_test.tex Sun Jan 30 15:26:26 2000 *************** *** 0 **** --- 1,18 ---- + \documentstyle{article} + % WARNING! THIS FILE WAS GENERATED AUTOMATICALLY BY c2man! + % DO NOT EDIT! CHANGES MADE TO THIS FILE WILL BE LOST! + \begin{document} + \section*{NAME} + backslash\_test --- test the treatment of '$\backslash$0' by the tool c2man. + \section*{SYNOPSIS} + \begin{verbatim} + #include + + extern void backslash_test(void); + \end{verbatim} + \section*{DESCRIPTION} + Test the treatment of '$\backslash$0' by the tool c2man if you + specify latex output via the commandline '-Hl' and for the + default unix manpages. + I hope I have not added any side effects. + \end{document}