only set, don't unset option lock

This commit is contained in:
Shaun Inman 2023-03-06 21:06:54 -05:00
parent 2632443c7b
commit c4d9102615

View file

@ -823,7 +823,7 @@ static struct Config {
static int Config_getValue(char* cfg, const char* key, char* out_value, int* lock) { static int Config_getValue(char* cfg, const char* key, char* out_value, int* lock) {
char* tmp = cfg; char* tmp = cfg;
while ((tmp = strstr(tmp, key))) { while ((tmp = strstr(tmp, key))) {
if (lock!=NULL) *lock = (tmp>cfg && *(tmp-1)=='-'); // prefixed with a `-` means lock if (lock!=NULL && tmp>cfg && *(tmp-1)=='-') *lock = 1; // prefixed with a `-` means lock
tmp += strlen(key); tmp += strlen(key);
if (!strncmp(tmp, " = ", 3)) break; if (!strncmp(tmp, " = ", 3)) break;
}; };