Skip to content
This repository was archived by the owner on Oct 27, 2022. It is now read-only.

Commit 6be6887

Browse files
authored
Remove leading/trailing whitespaces in config values (#40)
1 parent 9e63274 commit 6be6887

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/config.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,9 @@ parse_ini_file(IniFile) ->
437437
ets:delete(?MODULE, {AccSectionName, ValueName}),
438438
{AccSectionName, AccValues};
439439
[LineValue | _Rest] ->
440+
LineValueWithoutLeadTrailWS = string:trim(LineValue),
440441
{AccSectionName,
441-
[{{AccSectionName, ValueName}, LineValue} | AccValues]}
442+
[{{AccSectionName, ValueName}, LineValueWithoutLeadTrailWS} | AccValues]}
442443
end
443444
end
444445
end

src/config_util.erl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ fix_path_list(["."|Rest], Acc) ->
7272
fix_path_list(Rest, Acc);
7373
fix_path_list([Dir | Rest], Acc) ->
7474
fix_path_list(Rest, [Dir | Acc]).
75+

0 commit comments

Comments
 (0)