Added a rule to the conversion prescription for man pages

This commit is contained in:
2011-05-13 16:47:52 +00:00
parent dca54e8898
commit 53a4ead6a0
3 changed files with 854 additions and 832 deletions

View File

@ -147,8 +147,8 @@ overflow:;
*/
int Mx1_convert(struct Mx1 *m, char line_in[256], char line_out[256], int flag)
{
int l, num, keep= 0, ret, raw;
char word[256], buf[256], *remainder;
int l, num, keep= 0, ret, raw, i, backslash_count;
char word[256], buf[256], *remainder, *wpt;
m->count_in++;
l= strlen(line_in);
@ -273,6 +273,26 @@ int Mx1_convert(struct Mx1 *m, char line_in[256], char line_out[256], int flag)
return(0);
strcpy(line_out, line_in);
}
/* "-" which are not preceded by an uneven number of "\" will get
prepended one "\".
*/
l= strlen(line_out);
backslash_count= 0;
wpt= buf;
for(i= 0; i < l; i++) {
if(line_out[i] == '\\')
backslash_count++;
else if(line_out[i] == '-') {
if(backslash_count % 2 == 0)
*(wpt++)= '\\';
backslash_count= 0;
} else
backslash_count= 0;
*(wpt++)= line_out[i];
}
*wpt= 0;
strcpy(line_out, buf);
m->count_out++;
return(1);
}