The Windows Help backend now uses libcharset to the maximum extent
[sgt/halibut] / bk_man.c
index 276855e..0854e58 100644 (file)
--- a/bk_man.c
+++ b/bk_man.c
@@ -48,7 +48,7 @@ static manconfig man_configure(paragraph *source) {
                ret.mindepth = utoi(uadv(source->keyword));
            } else if (!ustricmp(source->keyword, L"man-filename")) {
                sfree(ret.filename);
-               ret.filename = utoa_dup(uadv(source->keyword));
+               ret.filename = dupstr(adv(source->origkeyword));
            }
        }
     }
@@ -62,17 +62,23 @@ static void man_conf_cleanup(manconfig cf)
     sfree(cf.filename);
 }
 
+paragraph *man_config_filename(char *filename)
+{
+    return cmdline_cfg_simple("man-filename", filename, NULL);
+}
+
 #define QUOTE_INITCTRL 1 /* quote initial . and ' on a line */
 #define QUOTE_QUOTES   2 /* quote double quotes by doubling them */
 
 void man_backend(paragraph *sourceform, keywordlist *keywords,
-                indexdata *idx) {
+                indexdata *idx, void *unused) {
     paragraph *p;
     FILE *fp;
     manconfig conf;
 
-    IGNORE(keywords);                 /* we don't happen to need this */
-    IGNORE(idx);                      /* or this */
+    IGNORE(unused);
+    IGNORE(keywords);
+    IGNORE(idx);
 
     conf = man_configure(sourceform);
 
@@ -343,7 +349,7 @@ static void man_rdaddwc(rdstringc *rs, word *text, word *end,
        if (removeattr(text->type) == word_Normal) {
            if (rs->pos > 0)
                quote_props &= ~QUOTE_INITCTRL;   /* not at start any more */
-           if (man_convert(text->text, 0, &c, quote_props))
+           if (man_convert(text->text, 0, &c, quote_props) || !text->alt)
                rdaddsc(rs, c);
            else
                man_rdaddwc(rs, text->alt, NULL, quote_props);