diff options
author | Felix Fietkau <nbd@nbd.name> | 2023-10-30 18:32:24 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2023-10-31 13:30:11 +0100 |
commit | eaf44c56968495ea4e500ebaa11ab1932d550bcd (patch) | |
tree | 56d0687428872798933b00f3049e5ac87ff015a0 /package/network/services/hostapd | |
parent | 220ab83cd119463a288b2c234484e4a79ae4e305 (diff) | |
download | upstream-eaf44c56968495ea4e500ebaa11ab1932d550bcd.tar.gz upstream-eaf44c56968495ea4e500ebaa11ab1932d550bcd.tar.bz2 upstream-eaf44c56968495ea4e500ebaa11ab1932d550bcd.zip |
hostapd: do not trim trailing whitespace, except for newline
Fixes adding SSID or key with trailing whitespace
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit a2d8226c4f45555f49542d6f047b70d44f23f7ec)
Diffstat (limited to 'package/network/services/hostapd')
-rw-r--r-- | package/network/services/hostapd/files/hostapd.uc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 88f01caa93..593840cca8 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -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; @@ -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; |