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

config: ignore leading and trailing whitespace #411

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pranjalkole
Copy link
Contributor

@pranjalkole pranjalkole commented Jan 23, 2022

Leading and trailing whitespace is now stripped before parsing the line.

getline returns line length, so strlen calls have been replaced with
that. Also, getline now runs until -1 is returned.

Additionally, the entire line (whitespace stripped) is now
printed to stderr when mako fails to parse an option.

Closes #107 and #282

@pranjalkole
Copy link
Contributor Author

Oops, there is a bug in this. If there is no newline after the last line, the last character is not read (since len is decremented by 1). I'm rebasing and force-pushing the fix.

@pranjalkole
Copy link
Contributor Author

I thought I would implement the "strip leading whitespace" in another commit, but it was small, so added here.

PS: Sorry for the noise

@pranjalkole pranjalkole changed the title config: ignore end-of-line whitespace config: ignore leading and trailing whitespace Jan 24, 2022
@murlakatamenka

This comment was marked as off-topic.

Leading and trailing whitespace is now stripped before parsing the line.

getline returns line length, so strlen calls have been replaced with
that. Also, getline now runs until -1 is returned.

Additionally, the entire line (whitespace stripped) is now
printed to stderr when mako fails to parse an option.
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.

strip ' and " from config
2 participants