Skip to content

[Bug]: Declare the variable with eval fails if value contains space char #1

@vollmeier-dev

Description

@vollmeier-dev

What happened?

Declare the variable with eval (line 256) fails if the value contains a space char (ascii 0x20).

For example, the following ini file:
[section1]
value1=abc def

Results to the following error:
ini-file-parser.sh: line 256: def: command not found

Expected behavior

Values containing spaces should work.

How do we reproduct the bug?

Parse a ini file with a value that contains a space char

Relevant log output

No response

Screeenshots

No response

Additional information

In line 256, enclose the value varaible in double quotes and it works:

eval "${section}_${key}=\"${value}\""

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions