else
depth = 0;
if (depth >= conf.mindepth) {
- fprintf(fp, ".SH \"");
+ if (depth > conf.mindepth)
+ fprintf(fp, ".SS \"");
+ else
+ fprintf(fp, ".SH \"");
if (conf.headnumbers && p->kwtext) {
man_text(fp, p->kwtext, FALSE, QUOTE_QUOTES, &conf);
fprintf(fp, " ");
return !err;
}
-static void man_rdaddwc(rdstringc *rs, word *text, word *end,
- int quote_props, manconfig *conf,
- charset_state *state) {
+static int man_rdaddwc(rdstringc *rs, word *text, word *end,
+ int quote_props, manconfig *conf,
+ charset_state *state) {
char *c;
for (; text && text != end; text = text->next) switch (text->type) {
if (towordstyle(text->type) == word_Emph &&
(attraux(text->aux) == attr_First ||
attraux(text->aux) == attr_Only)) {
- if (rs->pos > 0)
- quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
man_convert(NULL, 0, &c, quote_props, conf->charset, state);
rdaddsc(rs, c);
+ if (*c)
+ quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
sfree(c);
*state = charset_init_state;
rdaddsc(rs, "\\fI");
towordstyle(text->type) == word_WeakCode) &&
(attraux(text->aux) == attr_First ||
attraux(text->aux) == attr_Only)) {
- if (rs->pos > 0)
- quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
man_convert(NULL, 0, &c, quote_props, conf->charset, state);
rdaddsc(rs, c);
+ if (*c)
+ quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
sfree(c);
*state = charset_init_state;
rdaddsc(rs, "\\fB");
if (removeattr(text->type) == word_Normal) {
charset_state s2 = *state;
- if (rs->pos > 0)
- quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
if (man_convert(text->text, 0, &c, quote_props, conf->charset, &s2) ||
!text->alt) {
rdaddsc(rs, c);
+ if (*c)
+ quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
*state = s2;
} else {
- man_rdaddwc(rs, text->alt, NULL, quote_props, conf, state);
+ quote_props = man_rdaddwc(rs, text->alt, NULL,
+ quote_props, conf, state);
}
sfree(c);
} else if (removeattr(text->type) == word_WhiteSpace) {
- if (rs->pos > 0)
- quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
man_convert(L" ", 1, &c, quote_props, conf->charset, state);
rdaddsc(rs, c);
+ if (*c)
+ quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
sfree(c);
} else if (removeattr(text->type) == word_Quote) {
- if (rs->pos > 0)
- quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
man_convert(quoteaux(text->aux) == quote_Open ?
conf->lquote : conf->rquote, 0,
&c, quote_props, conf->charset, state);
rdaddsc(rs, c);
+ if (*c)
+ quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
sfree(c);
}
if (towordstyle(text->type) != word_Normal &&
(attraux(text->aux) == attr_Last ||
attraux(text->aux) == attr_Only)) {
- if (rs->pos > 0)
- quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
man_convert(NULL, 0, &c, quote_props, conf->charset, state);
rdaddsc(rs, c);
+ if (*c)
+ quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
sfree(c);
*state = charset_init_state;
rdaddsc(rs, "\\fP");
}
man_convert(NULL, 0, &c, quote_props, conf->charset, state);
rdaddsc(rs, c);
+ if (*c)
+ quote_props &= ~QUOTE_INITCTRL; /* not at start any more */
sfree(c);
+
+ return quote_props;
}
static void man_text(FILE *fp, word *text, int newline,