summaryrefslogtreecommitdiff
path: root/Build/source/texk/xdvik/hypertex.c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-04-14 08:35:50 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-04-14 08:35:50 +0000
commit8af55a14b7fb6dcc703f803ef3cd3cd359ae345d (patch)
treef828f1c548fdec0d51e315052a0cbdb58fd7d29e /Build/source/texk/xdvik/hypertex.c
parent3606cb1179eae47f2ee7d2569ae7ac024deb1310 (diff)
xdvik 22.87
git-svn-id: svn://tug.org/texlive/trunk@33436 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/xdvik/hypertex.c')
-rw-r--r--Build/source/texk/xdvik/hypertex.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/Build/source/texk/xdvik/hypertex.c b/Build/source/texk/xdvik/hypertex.c
index 51101667438..de4de61cf56 100644
--- a/Build/source/texk/xdvik/hypertex.c
+++ b/Build/source/texk/xdvik/hypertex.c
@@ -2058,23 +2058,24 @@ launch_program(const char *filename)
/* warn user if no application has been found. Help text needs to be constructed at
run-time, since we want the correct content-type in it. */
#if 0
- char *errmsg = NULL;
+ char *helptext = NULL;
#else
- char *errmsg = xstrdup("Please assign an application to the MIME type `");
- errmsg = xstrcat(errmsg, content_type);
- errmsg = xstrcat(errmsg, "' in your ~/.mailcap file. "
- "E.g. if you want to view the file with netscape, add the following line to your ~/.mailcap:\n");
- errmsg = xstrcat(errmsg, content_type);
- errmsg = xstrcat(errmsg, "; netscape -raise -remote 'openURL(%%s,new-window)'\n\n");
+ char *helptext = get_string_va("Please assign an application to the "
+ "MIME type `%s' in your ~/.mailcap file. "
+ "E.g. if you want to view the file with firefox, "
+ "add the following line to your ~/.mailcap:\n"
+ "%s; firefox '%%s'\n\n",
+ content_type, content_type);
#endif
popup_message(globals.widgets.top_level,
MSG_WARN,
- errmsg,
+ helptext,
"Could not determine an application for the file %s, MIME type `%s'.",
fullpath, content_type);
- /* FIXME: something's wrong with the memory allocation scheme here -
- can't free errmsg, it's already free'd inside popup_message() ?? */
- /* free(errmsg); */
+ /* FIXME: We can't free helptext here, because it won't be used until
+ * the popup comes up and the user clicks on "Help". This doesn't
+ * happen until after this function returns. */
+ /* free(helptext); */
free(fullpath);
return;
}