mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-07 17:17:44 +03:00
parse-helpers: Add PATH_KEEP_TRAILING_SLASH
(cherry picked from commit ce60b3a40a
)
This commit is contained in:
parent
ff45789ea3
commit
979b2abbdd
@ -40,7 +40,7 @@ int path_simplify_and_warn(
|
|||||||
lvalue, fatal ? "" : ", ignoring", path);
|
lvalue, fatal ? "" : ", ignoring", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
path_simplify(path);
|
path_simplify_full(path, flag & PATH_KEEP_TRAILING_SLASH ? PATH_SIMPLIFY_KEEP_TRAILING_SLASH : 0);
|
||||||
|
|
||||||
if (!path_is_valid(path))
|
if (!path_is_valid(path))
|
||||||
return log_syntax(unit, LOG_ERR, filename, line, SYNTHETIC_ERRNO(EINVAL),
|
return log_syntax(unit, LOG_ERR, filename, line, SYNTHETIC_ERRNO(EINVAL),
|
||||||
|
@ -4,9 +4,10 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PATH_CHECK_FATAL = 1 << 0, /* If not set, then error message is appended with 'ignoring'. */
|
PATH_CHECK_FATAL = 1 << 0, /* If not set, then error message is appended with 'ignoring'. */
|
||||||
PATH_CHECK_ABSOLUTE = 1 << 1,
|
PATH_CHECK_ABSOLUTE = 1 << 1,
|
||||||
PATH_CHECK_RELATIVE = 1 << 2,
|
PATH_CHECK_RELATIVE = 1 << 2,
|
||||||
|
PATH_KEEP_TRAILING_SLASH = 1 << 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
int path_simplify_and_warn(
|
int path_simplify_and_warn(
|
||||||
|
Loading…
Reference in New Issue
Block a user