Windows: use _wfullpath for realpath

This commit is contained in:
vylsaz 2025-01-11 18:08:33 +00:00 committed by dzaima
parent e12ca55ee0
commit 24bd6735bc
2 changed files with 3 additions and 13 deletions

View File

@ -1,9 +1,6 @@
#include "realpath.h"
char* realpath (const char *__restrict path, char *__restrict resolved_path) {
return _fullpath(NULL, path, 0);
WCHAR* realpath (const WCHAR*__restrict path, WCHAR*__restrict resolved_path) {
return _wfullpath(NULL, path, 0);
}
bool winIsAbsolute(const char* path) { // TODO something more proper
return *path && path[1]==':' && (!path[2] || path[2]=='/' || path[2]=='\\');
}
}

View File

@ -1,7 +0,0 @@
#ifndef REALPATH_H
#define REALPATH_H
char* realpath(const char *__restrict path, char *__restrict resolved_path);
bool winIsAbsolute(const char* path);
#endif /* REALPATH_H */