Skip to content

Commit 5bb3a9e

Browse files
committed
Support tabs as seaprators when parsing fs config
Signed-off-by: Jo-Philipp Wich <[email protected]>
1 parent 8597212 commit 5bb3a9e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

canned_fs_config.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ int load_canned_fs_config(const char* fn) {
5252
canned_data = (Path*) realloc(canned_data, canned_alloc * sizeof(Path));
5353
}
5454
Path* p = canned_data + canned_used;
55-
p->path = strdup(strtok(line, " "));
56-
p->uid = atoi(strtok(NULL, " "));
57-
p->gid = atoi(strtok(NULL, " "));
58-
p->mode = strtol(strtok(NULL, " "), NULL, 8); // mode is in octal
55+
p->path = strdup(strtok(line, " \t"));
56+
p->uid = atoi(strtok(NULL, " \t"));
57+
p->gid = atoi(strtok(NULL, " \t"));
58+
p->mode = strtol(strtok(NULL, " \t"), NULL, 8); // mode is in octal
5959
p->capabilities = 0;
6060

6161
char* token = NULL;
6262
do {
63-
token = strtok(NULL, " ");
63+
token = strtok(NULL, " \t");
6464
if (token && strncmp(token, "capabilities=", 13) == 0) {
6565
p->capabilities = strtoll(token+13, NULL, 0);
6666
break;

0 commit comments

Comments
 (0)