mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 18:00:26 +00:00
Add GetWorkingDirectory for linux
This commit is contained in:
parent
ccff74a79c
commit
37ab94e7b4
@ -147,6 +147,16 @@ std::unique_ptr<PlatformSharedMemory> CreatePlatformSharedMemory(
|
|||||||
|
|
||||||
void PlatformInit() {}
|
void PlatformInit() {}
|
||||||
|
|
||||||
|
std::string GetWorkingDirectory() {
|
||||||
|
char result[FILENAME_MAX];
|
||||||
|
if (!getcwd(result, sizeof(result)))
|
||||||
|
return "";
|
||||||
|
std::string working_dir = std::string(result, strlen(result));
|
||||||
|
EnsureEndsInSlash(working_dir);
|
||||||
|
return working_dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string NormalizePath(const std::string& path) {
|
std::string NormalizePath(const std::string& path) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
char name[PATH_MAX + 1];
|
char name[PATH_MAX + 1];
|
||||||
|
Loading…
Reference in New Issue
Block a user