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

Strings with embedded «\"» are not handled correctly #1

Closed
shlomif opened this issue May 24, 2017 · 2 comments
Closed

Strings with embedded «\"» are not handled correctly #1

shlomif opened this issue May 24, 2017 · 2 comments
Assignees
Labels

Comments

@shlomif
Copy link

shlomif commented May 24, 2017

Hi!

With this CMakeLists.txt file:

ADD_DEFINITIONS("-DLOCOFFDIR=\"500\"")

IF ("${NO_OFFENSIVE}")
    ADD_DEFINITIONS("-DNO_OFFENSIVE=1")
ENDIF()

The string in the first line extends to the end of the document with this repository's cmake syntax. I can provide a screenshot and perhaps a regression automated test should be written.

Credit is in part due to shlomif/fortune-mod#9 which made me discover it.

@pboettch pboettch self-assigned this May 29, 2017
@pboettch pboettch added the bug label May 29, 2017
@pboettch
Copy link
Owner

I already fixed this last week, but it was before you created the issue. I push-forced a new version of the commit, referencing this issue.

Would you allow a remark concerning your cmake-code with which you detected the problem? You don't need to escape anything in fact. The following works as you'd expect (also consider using lower-case cmake commands as recommended by CMake since 2.8 iirc):

add_definitions(-DLOCOFFDIR="500")

if("${NO_OFFENSIVE}")
    add_definitions(-DNO_OFFENSIVE=1)
endif()

@shlomif
Copy link
Author

shlomif commented May 29, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants