mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-31 17:52:27 +00:00
Fix bug with realpath() on Windows
This commit is contained in:
parent
2816df59b2
commit
f31a98d50a
4 changed files with 57 additions and 3 deletions
|
@ -20,6 +20,7 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/mem/gc.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
@ -79,3 +80,12 @@ TEST(realpath, test6) {
|
|||
ASSERT_NE(NULL, name);
|
||||
EXPECT_STREQ("/", name);
|
||||
}
|
||||
|
||||
TEST(realpath, c_drive) {
|
||||
if (!IsWindows())
|
||||
return;
|
||||
char buf[PATH_MAX];
|
||||
ASSERT_STREQ("/c", realpath("c:", buf));
|
||||
ASSERT_STREQ("/c", realpath("c:", buf));
|
||||
ASSERT_STREQ("/c/Windows", realpath("c:\\Windows", buf));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue