From 73142b793562158babf717422262bd1011ef17e4 Mon Sep 17 00:00:00 2001 From: Burt P Date: Mon, 6 Jan 2020 00:53:51 -0600 Subject: shell: new flag/funcs for escaping label part in keys Will allow formerly forbidden characters in a label, "#$=" See: https://github.com/lpereira/hardinfo/issues/509 Signed-off-by: Burt P --- includes/shell.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'includes/shell.h') diff --git a/includes/shell.h b/includes/shell.h index b70b963e..927a9adf 100644 --- a/includes/shell.h +++ b/includes/shell.h @@ -227,11 +227,16 @@ void shell_set_remote_label(Shell *shell, gchar *label); * ! = show details (moreinfo) in reports * * = highlight/select this row * ^ = value is/has a vendor string + * @ = label is escaped with key_label_escape() */ gboolean key_is_flagged(const gchar *key); /* has $[][]$ at the start of the key */ gboolean key_is_highlighted(const gchar *key); /* flag '*' = select/highlight */ gboolean key_wants_details(const gchar *key); /* flag '!' = report should include the "moreinfo" */ gboolean key_value_has_vendor_string(const gchar *key); /* flag '^' = try and match the value to a vendor */ +#define key_label_escape(LBL) (gg_strescape(LBL, NULL, "=$#")) +gboolean key_label_is_escaped(const gchar *key); /* flag '@' = the label part is key_label_escape()-d and + * needs to be g_strcompress()-ed before use. + * key_get_components() will do this automatically for label. */ gchar *key_mi_tag(const gchar *key); /* moreinfo lookup tag */ const gchar *key_get_name(const gchar *key); /* get the key's name, flagged or not */ /* -- cgit v1.2.3