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

compile_commands.json breaks when paths contain spaces #291

Open
WebFreak001 opened this issue Mar 15, 2024 · 3 comments
Open

compile_commands.json breaks when paths contain spaces #291

WebFreak001 opened this issue Mar 15, 2024 · 3 comments

Comments

@WebFreak001
Copy link

the file property isn't really defined what exactly it holds, so it's kinda implementation defined and reggae puts multiple files in it, space separated - which would break for consumers trying to split just by spaces, because file names with spaces are not escaped.

Furthermore the commands in command are also not escaped and contain stuff like

"command": "/usr/bin/dmd -makedeps=.reggae/objs/./gdb-test.objs/GDB Test/source_app.o.dep -debug -g -w -version=Have_gdb_test '-I/home/webfreak/dev/GDB Test/source/' -of.reggae/objs/./gdb-test.objs/GDB Test/source_app.o -color=on -c /home/webfreak/dev/GDB Test/source/app.d /home/webfreak/dev/GDB Test/source/baz.d /home/webfreak/dev/GDB Test/source/scope.d /home/webfreak/dev/GDB Test/source/xd.d"

which would just break if you were to try to run them like this.

@atilaneves
Copy link
Owner

What would the solution be? It can't be to add backslashes before the spaces, since that wouldn't be a valid JSON string anymore.

@WebFreak001
Copy link
Author

backslash would work, quotes would work, just anything that makes the shell run the command properly when run

@nordlow
Copy link

nordlow commented May 29, 2024

As I already wrote at #303 (comment), some string literal escape sequences are missing an extra backslash. It might be as simple as replacing every string literal backslash with two backslashes.

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

No branches or pull requests

3 participants