Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix excessive escaping when using ucl_object_fromstring() #262

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix excessive escaping when using ucl_object_fromstring()
UCL_STRING_ESCAPE might be useful for something but it's not good
default behaviour. Strings are escaped during output to meet the needs
of the output format, so adding escape sequences while building the
object results in things being escaped twice.
  • Loading branch information
flowerysong committed Mar 20, 2022
commit dcb43f09b1a2629f9506411bd63917f452a11f36
4 changes: 2 additions & 2 deletions src/ucl_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -3068,13 +3068,13 @@ ucl_object_type (const ucl_object_t *obj)
ucl_object_t*
ucl_object_fromstring (const char *str)
{
return ucl_object_fromstring_common (str, 0, UCL_STRING_ESCAPE);
return ucl_object_fromstring_common (str, 0, UCL_STRING_RAW);
}

ucl_object_t *
ucl_object_fromlstring (const char *str, size_t len)
{
return ucl_object_fromstring_common (str, len, UCL_STRING_ESCAPE);
return ucl_object_fromstring_common (str, len, UCL_STRING_RAW);
}

ucl_object_t *
Expand Down