Skip to content

Commit

Permalink
hostapd: do not trim trailing whitespace, except for newline
Browse files Browse the repository at this point in the history
Fixes adding SSID or key with trailing whitespace

Signed-off-by: Felix Fietkau <[email protected]>
(cherry picked from commit a2d8226)
  • Loading branch information
nbd168 committed Oct 31, 2023
1 parent 220ab83 commit eaf44c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/network/services/hostapd/files/hostapd.uc
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ function iface_load_config(filename)
let bss;
let line;
while ((line = trim(f.read("line"))) != null) {
while ((line = rtrim(f.read("line"), "\n")) != null) {
let val = split(line, "=", 2);
if (!val[0])
continue;
Expand All @@ -593,7 +593,7 @@ function iface_load_config(filename)
push(config.radio.data, line);
}

while ((line = trim(f.read("line"))) != null) {
while ((line = rtrim(f.read("line"), "\n")) != null) {
if (line == "#default_macaddr")
bss.default_macaddr = true;

Expand Down

0 comments on commit eaf44c5

Please sign in to comment.