mirror of
https://github.com/lakinduakash/linux-wifi-hotspot.git
synced 2024-11-24 21:20:12 +00:00
don't remove spaces from SSID or passphrase
This commit is contained in:
parent
ea40a80eea
commit
9d1d031b9e
@ -57,11 +57,14 @@ int read_config_file() {
|
||||
|
||||
int i=0;
|
||||
while (getline(cFile, line)) {
|
||||
line.erase(std::remove_if(line.begin(), line.end(), isspace),
|
||||
line.end());
|
||||
auto delimiterPos = line.find('=');
|
||||
if (!(line.find("SSID") < delimiterPos) && !(line.find("PASSPHRASE") < delimiterPos)) {
|
||||
line.erase(std::remove_if(line.begin(), line.end(), isspace),
|
||||
line.end());
|
||||
}
|
||||
if (line[0] == '#' || line.empty())
|
||||
continue;
|
||||
auto delimiterPos = line.find('=');
|
||||
delimiterPos = line.find('='); //check again in case it changed
|
||||
auto name = line.substr(0, delimiterPos);
|
||||
auto value = line.substr(delimiterPos + 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user