path-util: split filename_is_valid() in two
Add a helper filename_part_is_valid() which does half of what filename_is_valid() does: it checks for valid chars and length, but does not filter out ".", ".." and "", as these are OK as parts of filenames, just not alone.
This commit is contained in:
@@ -163,6 +163,7 @@ const char *last_path_component(const char *path);
|
||||
int path_extract_filename(const char *path, char **ret);
|
||||
int path_extract_directory(const char *path, char **ret);
|
||||
|
||||
bool filename_part_is_valid(const char *p) _pure_;
|
||||
bool filename_is_valid(const char *p) _pure_;
|
||||
bool path_is_valid_full(const char *p, bool accept_dot_dot) _pure_;
|
||||
static inline bool path_is_valid(const char *p) {
|
||||
|
||||
Reference in New Issue
Block a user