Skip to content

Syntax error on special charachters like & #39

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

Open
jostmart opened this issue Mar 30, 2021 · 1 comment
Open

Syntax error on special charachters like & #39

jostmart opened this issue Mar 30, 2021 · 1 comment

Comments

@jostmart
Copy link

I get syntax error when parsing repo files that contain & in "value".

bash-ini-parser: eval: line 86: syntax error near unexpected token `&'
bash-ini-parser: eval: line 86: `mirrorlist=( http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra )'
bash-ini-parser: eval: line 89: syntax error near unexpected token `}'
bash-ini-parser: eval: line 89: `}'
[centos-kernel]
name=CentOS LTS Kernels for $basearch
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=kernel&infra=$infra

As a quick test, I escaped & and the example below passes.

[centos-kernel]
name=CentOS LTS Kernels for $basearch
mirrorlist=http://mirrorlist.centos.org/?release=$releasever\&arch=$basearch\&repo=kernel\&infra=$infra
@albfan
Copy link
Owner

albfan commented Mar 30, 2021

There's an initial section of escaped vars

https://github.com/albfan/bash-ini-parser/blob/master/bash-ini-parser#L30

I expected lot of corner cases for this but at least a failed test to describe what it supports and what it don't would be interesting.

Let me know if you can code something around that

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