summaryrefslogtreecommitdiff
path: root/hardinfo/util.c
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2018-10-21 13:03:06 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2018-10-22 10:27:24 -0700
commit970174b0897d40b804808632784ffa1544d9da93 (patch)
treec0c98fc8c65301fdeb101e54724ab7714155d01b /hardinfo/util.c
parentdf19b2ba34336e1a532377ef44da59dfb6616815 (diff)
don't use html in text-only output
Fixes https://github.com/lpereira/hardinfo/issues/266 This is also needed so that vendor urls can be links where appropriate. Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'hardinfo/util.c')
-rw-r--r--hardinfo/util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hardinfo/util.c b/hardinfo/util.c
index 4b1637d6..04790dc2 100644
--- a/hardinfo/util.c
+++ b/hardinfo/util.c
@@ -491,6 +491,15 @@ void parameters_init(int *argc, char ***argv, ProgramParameters * param)
if (report_format && g_str_equal(report_format, "html"))
param->report_format = REPORT_FORMAT_HTML;
+ /* html ok?
+ * gui: yes
+ * report html: yes
+ * report text: no
+ * anything else? */
+ param->html_ok = TRUE;
+ if (param->create_report && param->report_format != REPORT_FORMAT_HTML)
+ param->html_ok = FALSE;
+
gchar *confdir = g_build_filename(g_get_user_config_dir(), "hardinfo", NULL);
if (!g_file_test(confdir, G_FILE_TEST_EXISTS)) {
mkdir(confdir, 0744);