tests: clarify test_path_startswith return value (#4508)
A pendant for #4481.
This commit is contained in:
committed by
GitHub
parent
87b6ba21b5
commit
0470289b6e
@@ -354,6 +354,16 @@ char* path_startswith(const char *path, const char *prefix) {
|
||||
assert(path);
|
||||
assert(prefix);
|
||||
|
||||
/* Returns a pointer to the start of the first component after the parts matched by
|
||||
* the prefix, iff
|
||||
* - both paths are absolute or both paths are relative,
|
||||
* and
|
||||
* - each component in prefix in turn matches a component in path at the same position.
|
||||
* An empty string will be returned when the prefix and path are equivalent.
|
||||
*
|
||||
* Returns NULL otherwise.
|
||||
*/
|
||||
|
||||
if ((path[0] == '/') != (prefix[0] == '/'))
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user