Skip to content

Improve error message truncation with closing delimiters#3478

Open
itchyny wants to merge 1 commit intojqlang:masterfrom
itchyny:fix-dump-string-delim
Open

Improve error message truncation with closing delimiters#3478
itchyny wants to merge 1 commit intojqlang:masterfrom
itchyny:fix-dump-string-delim

Conversation

@itchyny
Copy link
Contributor

@itchyny itchyny commented Feb 13, 2026

Truncated strings now show closing delimiters: ..." for strings,
...] for arrays, and ...} for objects, making error messages clearer.

@itchyny
Copy link
Contributor Author

itchyny commented Feb 14, 2026

I think the error buffer 15 is too small. I'd like to increase to 20. WDYT?

@wader
Copy link
Member

wader commented Feb 14, 2026

I think the error buffer 15 is too small. I'd like to increase to 20. WDYT?

There are some 30 used with jv_dump_string_trunc already, maybe increase all to that?

$ git grep -E '(key|err)buf.*\[.*\]' | cat
src/builtin.c:  char errbuf[15];
src/builtin.c:  char errbuf1[15],errbuf2[15];
src/execute.c:        char errbuf[15];
src/execute.c:        char errbuf[30];
src/execute.c:        char keybuf[15];
src/execute.c:        char errbuf[30];
src/execute.c:          char errbuf[15];
src/parser.c:    char errbuf[15];
src/parser.y:    char errbuf[15];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants