Handle DOS format files correctly. Thanks to dive for the report :)
This commit is contained in:
parent
3d95c70003
commit
55788d34ff
1 changed files with 2 additions and 2 deletions
|
|
@ -346,8 +346,8 @@ parse_ini() {
|
||||||
# Ignore the line if it's a comment.
|
# Ignore the line if it's a comment.
|
||||||
[[ "$LINE" =~ ^[[:blank:]]*([$COMMENT_CHARS].*)*$ ]] && continue
|
[[ "$LINE" =~ ^[[:blank:]]*([$COMMENT_CHARS].*)*$ ]] && continue
|
||||||
|
|
||||||
# Strip the trailing whitespace from the line (leading whitespace has already been stripped by read).
|
# Strip the trailing whitespace and any \r from the line (leading whitespace has already been stripped by read).
|
||||||
LINE="${LINE/%*([[:blank:]])/}"
|
LINE="${LINE/%*([[:blank:]])*([$'\r'])/}"
|
||||||
|
|
||||||
# Process the line.
|
# Process the line.
|
||||||
if [[ "${LINE:0:1}" == "[" ]]; then # Found the beginning of a section definition.
|
if [[ "${LINE:0:1}" == "[" ]]; then # Found the beginning of a section definition.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue