mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 20:00:12 +01:00
glib-aux: also backslash escape ASCII DEL character in nm_utils_buf_utf8safe_escape()
(cherry picked from commit 4b21056fde)
This commit is contained in:
parent
4230b4c618
commit
199db653d1
2 changed files with 8 additions and 4 deletions
|
|
@ -2996,7 +2996,7 @@ nm_utils_buf_utf8safe_escape(gconstpointer buf,
|
|||
ch,
|
||||
(ch == '\\'
|
||||
|| (NM_FLAGS_HAS(flags, NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_CTRL)
|
||||
&& nm_ascii_is_ctrl(ch))
|
||||
&& nm_ascii_is_ctrl_or_del(ch))
|
||||
|| (NM_FLAGS_HAS(flags, NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_NON_ASCII)
|
||||
&& nm_ascii_is_non_ascii(ch)))))
|
||||
return str;
|
||||
|
|
@ -3016,7 +3016,7 @@ nm_utils_buf_utf8safe_escape(gconstpointer buf,
|
|||
if (ch == '\\')
|
||||
nm_str_buf_append_c(&strbuf, '\\', '\\');
|
||||
else if ((NM_FLAGS_HAS(flags, NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_CTRL)
|
||||
&& nm_ascii_is_ctrl(ch))
|
||||
&& nm_ascii_is_ctrl_or_del(ch))
|
||||
|| (NM_FLAGS_HAS(flags, NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_NON_ASCII)
|
||||
&& nm_ascii_is_non_ascii(ch)))
|
||||
_str_buf_append_c_escape_octal(&strbuf, ch);
|
||||
|
|
|
|||
|
|
@ -1446,10 +1446,14 @@ GType nm_g_type_find_implementing_class_for_property(GType gtype, const char *pn
|
|||
typedef enum {
|
||||
NM_UTILS_STR_UTF8_SAFE_FLAG_NONE = 0,
|
||||
|
||||
/* This flag only has an effect during escaping. */
|
||||
/* This flag only has an effect during escaping.
|
||||
*
|
||||
* It will backslash escape ascii characters according to nm_ascii_is_ctrl_or_del(). */
|
||||
NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_CTRL = 0x0001,
|
||||
|
||||
/* This flag only has an effect during escaping. */
|
||||
/* This flag only has an effect during escaping.
|
||||
*
|
||||
* It will backslash escape ascii characters according to nm_ascii_is_non_ascii(). */
|
||||
NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_NON_ASCII = 0x0002,
|
||||
|
||||
/* This flag only has an effect during escaping to ensure we
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue