Archived
1
0
Fork 0

common/path.c: fixed bug whit trailing slash in fmt_path

This commit is contained in:
Henrik Hautakoski 2010-06-09 22:44:05 +02:00 committed by Henrik Hautakoski
parent fd3d2c0fa6
commit b326f23c85
2 changed files with 11 additions and 21 deletions

View file

@ -14,17 +14,14 @@ void test_fmt_path() {
ptr = fmt_path("/usr/src/", "linux", 0);
assert_string(ptr, "/usr/src/linux");
free(ptr);
/*
ptr = fmt_path("/segment1/segment2/", "segment3/", 1);
ptr = fmt_path("/segment1/segment2/", "segment3", 1);
assert_string(ptr, "/segment1/segment2/segment3/");
free(ptr);
*/
/*
ptr = fmt_path("/stuff/with/ahell/lot/of/slashes/at/the/", "end/////////", 1);
assert_string(ptr, "/stuff/with/ahell/lot/of/slashes/at/the/end/////////");
ptr = fmt_path("/stuff/with/ahell/lot/of/slashes/at/the/", "end", 1);
assert_string(ptr, "/stuff/with/ahell/lot/of/slashes/at/the/end/");
free(ptr);
*/
ptr = fmt_path("/mnt/cdrom", "keff", 0);
assert_string(ptr, "/mnt/cdrom/keff");