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

Provide a jvp_dump_raw_string function to implement the combination o… #1789

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rain-1
Copy link
Contributor

@rain-1 rain-1 commented Jan 14, 2019

…f flags -r and -a (raw and ascii)

@coveralls
Copy link

coveralls commented Jan 14, 2019

Coverage Status

Coverage increased (+0.4%) to 84.869% when pulling a3b18f8 on rain-1:master into 4b4fefa on stedolan:master.

@@ -114,13 +114,18 @@ static void put_indent(int n, int flags, FILE* fout, jv* strout, int T) {
}

static void jvp_dump_string(jv str, int ascii_only, FILE* F, jv* S, int T) {
put_char('"', F, S, T);
jvp_dump_string_raw(str, ascii_only, F, S, T);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the string has double-quote characters in it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I guess this isn't new...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's actually a good question.. can jvp_dump_string be tricked into producing bad output?

@nicowilliams
Copy link
Contributor

Hey, thanks for this.

bb010g added a commit to bb010g/jq that referenced this pull request Oct 22, 2019
Escapes are still printed whenever characters
outside the ASCII plane are encountered. To avoid
ambiguity, backslash is the only ASCII character
escaped (as `\\`).

Fixes jqlang#1788, properly this time. Closes jqlang#1789.
bb010g added a commit to bb010g/jq that referenced this pull request Oct 22, 2019
Escapes are still printed whenever characters
outside the ASCII plane are encountered. To avoid
ambiguity, backslash is the only ASCII character
escaped (as `\\`).

Fixes jqlang#1788, properly this time. Closes jqlang#1789.
@bb010g bb010g mentioned this pull request Oct 22, 2019
bb010g added a commit to bb010g/jq that referenced this pull request Oct 26, 2019
Escapes are still printed whenever characters
outside the ASCII plane are encountered. To avoid
ambiguity, backslash is the only ASCII character
escaped (as `\\`).

Fixes jqlang#1788, properly this time. Closes jqlang#1789.
bb010g added a commit to bb010g/jq that referenced this pull request Sep 20, 2020
Escapes are still printed whenever characters
outside the ASCII plane are encountered. To avoid
ambiguity, backslash is the only ASCII character
escaped (as `\\`).

Fixes jqlang#1788, properly this time. Closes jqlang#1789.
bb010g added a commit to bb010g/jq that referenced this pull request Sep 20, 2020
Escapes are still printed whenever characters
outside the ASCII plane are encountered. To avoid
ambiguity, backslash is the only ASCII character
escaped (as `\\`).

Fixes jqlang#1788, properly this time. Closes jqlang#1789.
@itchyny itchyny added the bug label Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants