mirror of
https://github.com/likle/cwalk.git
synced 2026-10-28 09:44:01 +00:00
#17 fixed cwk_path_get_relative with relative base
This commit is contained in:
1 parent
82eaf2ad3e
commit
795a5d9d18
3 files changed
+25
-1
No files matched your search
@@ -71,6 +71,28 @@ int relative_check()
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int relative_relative_and_absolute()
|
||||
{
|
||||
char result[FILENAME_MAX];
|
||||
size_t length;
|
||||
|
||||
cwk_path_set_style(CWK_STYLE_UNIX);
|
||||
|
||||
*result = 1;
|
||||
|
||||
length = cwk_path_get_relative("./foo", "/bar", result, sizeof(result));
|
||||
|
||||
if (length != 0) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (*result != '\0') {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int relative_different_roots()
|
||||
{
|
||||
char result[FILENAME_MAX];
|
||||
|
||||
Reference in new issue
Block a user