mirror of
https://github.com/FunKey-Project/fkgpiod.git
synced 2026-02-19 15:51:33 +01:00
handle filenames with embedded space characters
Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
parent
c85fa5cd57
commit
4b67fe0851
@ -197,6 +197,7 @@ bool parse_config_line(char *line, mapping_list_t *list,
|
||||
uint32_t gpio_mask = 0;
|
||||
mapping_t *existing_mapping, new_mapping;
|
||||
|
||||
buffer[0] = '\0';
|
||||
token = strtok_r(line, " \t", &next_token);
|
||||
while (token != NULL) {
|
||||
switch (state) {
|
||||
@ -288,7 +289,10 @@ bool parse_config_line(char *line, mapping_list_t *list,
|
||||
}
|
||||
case STATE_LOAD:
|
||||
case STATE_TYPE:
|
||||
strncpy(buffer, token, MAX_LINE_LENGTH);
|
||||
if (buffer[0] != '\0') {
|
||||
strncat(buffer, " ", MAX_LINE_LENGTH);
|
||||
}
|
||||
strncat(buffer, token, MAX_LINE_LENGTH);
|
||||
break;
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user