mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
session: abort process_line early if line contains no key
This commit is contained in:
parent
5cb3583108
commit
3460d5be98
1 changed files with 3 additions and 5 deletions
|
|
@ -45,18 +45,16 @@ process_line(char *line)
|
|||
}
|
||||
*p = '\0';
|
||||
key = string_strip(line);
|
||||
if (string_null_or_empty(key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
struct buf value;
|
||||
buf_init(&value);
|
||||
buf_add(&value, string_strip(++p));
|
||||
buf_expand_shell_variables(&value);
|
||||
buf_expand_tilde(&value);
|
||||
if (string_null_or_empty(key)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
setenv(key, value.buf, 1);
|
||||
error:
|
||||
free(value.buf);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue