[openwrt/openwrt] hostapd: do not trim trailing whitespace, except for newline
LEDE Commits
lede-commits at lists.infradead.org
Tue Oct 31 05:30:18 PDT 2023
nbd pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/eaf44c56968495ea4e500ebaa11ab1932d550bcd
commit eaf44c56968495ea4e500ebaa11ab1932d550bcd
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Oct 30 18:32:24 2023 +0100
hostapd: do not trim trailing whitespace, except for newline
Fixes adding SSID or key with trailing whitespace
Signed-off-by: Felix Fietkau <nbd at nbd.name>
(cherry picked from commit a2d8226c4f45555f49542d6f047b70d44f23f7ec)
---
package/network/services/hostapd/files/hostapd.uc | 4 ++--
1 file 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;
More information about the lede-commits
mailing list