Mail Archives: djgpp-workers/2000/08/24/01:46:04
> Date: Wed, 23 Aug 2000 17:42:18 +0200
> From: Laurynas Biveinis <lauras AT softhome DOT net>
>
> + last_part = basename(path_copy);
> + if (*last_part == '\0')
> + {
> + /* If basename() returned pointer to the end of string, cut the last
> + * dir separator and try again.
> + */
> + *(last_part - 1) = '\0';
> + last_part = basename(path_copy);
> + }
What does this code produce when the argument is "c:/" or "c:"?
> + printf("Running readlink() testsuite:\n");
> + test_success( 1, "test1", "test1");
> + test_success( 2, "test1/", "test1");
> + test_success( 3, "dir1/test1", "dir1/test1");
> + test_success( 4, "dirtest/file1", "dir1/file1");
> + test_success( 5, "dirtest/test1", "dir1/test1");
> + test_success( 6, "dirtest/test6/file", "dir1/dir2/file");
> + printf("Done.\n");
My advice would be to always test DOS-style file names with drive
letters as well.
- Raw text -