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

semicolon in wifi password/name creates invalid output #431

Open
Poohl opened this issue Oct 18, 2023 · 1 comment
Open

semicolon in wifi password/name creates invalid output #431

Poohl opened this issue Oct 18, 2023 · 1 comment

Comments

@Poohl
Copy link

Poohl commented Oct 18, 2023

ISSUE

As the name suggests, configure the project with a semicolon in the Wifi name or password and the build will fail due to /bin/sh: 1: Syntax error: Unterminated quoted string because the cmake splits the argument into a list at the semicolon.

Example to reproduce:

cmake -DPICO_BOARD:STRING=pico_w -DWIFI_SSID:STRING="wifiname" -DWIFI_PASSWORD:STRING="pass;word"  -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/arm-none-eabi-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/arm-none-eabi-g++ -Bbuild -G Ninja

resulting in this output in build.ninja:

DEFINES = .... -DWIFI_PASSWORD=\"pass -DWIFI_SSID=\"wifiname\" -Dword"

FIX

by passing \; you can make it work, which means you have to pass \\\; on the shell because it eats the first and then every second. I'm not sure this can even be fixed in the build process itself.

@jcarranz97
Copy link

I think the workaround of using \\\; is the best solution here as this is a cmake feature as mentioned here.

Even in the cmake discourse forum, this topic was discussed and Alain Martin recommended to use \\\;
https://discourse.cmake.org/t/escaping-semicolons-in-cmake-configure-depends/447

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

2 participants