diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-05-15 10:37:01 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-05-15 10:37:01 +0100 |
| commit | baf219ee2fc0ffaad73015c35d650a53b84294c5 (patch) | |
| tree | bca97a9ba33de3215a2657eac59ccc3aaec1622b /src/file.cc | |
| parent | 1788126f385c0d656b6addb0731f6205cc4856e5 (diff) | |
Fix duplicate buffer problem, fix real_path beahviour
Diffstat (limited to 'src/file.cc')
| -rw-r--r-- | src/file.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/file.cc b/src/file.cc index 6773e6e0..fdca896f 100644 --- a/src/file.cc +++ b/src/file.cc @@ -90,7 +90,10 @@ String real_path(StringView filename) auto it = find(existing.rbegin(), existing.rend(), '/'); if (it == existing.rend()) - return filename.str(); + { + char cwd[1024]; + return format("{}/{}", getcwd(cwd, 1024), filename); + } existing = StringView{existing.begin(), it.base()-1}; non_existing = StringView{it.base(), filename.end()}; |
