Support comments in fs config
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
parent
5bb3a9e3de
commit
af498dbd68
@ -53,6 +53,10 @@ int load_canned_fs_config(const char* fn) {
|
|||||||
}
|
}
|
||||||
Path* p = canned_data + canned_used;
|
Path* p = canned_data + canned_used;
|
||||||
p->path = strdup(strtok(line, " \t"));
|
p->path = strdup(strtok(line, " \t"));
|
||||||
|
|
||||||
|
if (!p->path || !*p->path || *p->path == '#')
|
||||||
|
continue;
|
||||||
|
|
||||||
p->uid = atoi(strtok(NULL, " \t"));
|
p->uid = atoi(strtok(NULL, " \t"));
|
||||||
p->gid = atoi(strtok(NULL, " \t"));
|
p->gid = atoi(strtok(NULL, " \t"));
|
||||||
p->mode = strtol(strtok(NULL, " \t"), NULL, 8); // mode is in octal
|
p->mode = strtol(strtok(NULL, " \t"), NULL, 8); // mode is in octal
|
||||||
|
Reference in New Issue
Block a user