diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-02 20:00:13 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-07-02 20:00:13 -0400 |
| commit | 6e1425e3123855422068738f0911d5cac9bb0aef (patch) | |
| tree | fe9e93e40d174bafeb20b74e7da8ed79c562ac19 /src/os.cpp | |
| parent | dd627372660209cc5a8ab294d5811b97cd1f56f5 (diff) | |
| parent | 06e8c2e5194439ce5b66f18fcf60108604449957 (diff) | |
| download | zig-6e1425e3123855422068738f0911d5cac9bb0aef.tar.gz zig-6e1425e3123855422068738f0911d5cac9bb0aef.zip | |
Merge remote-tracking branch 'origin/master' into llvm7
Diffstat (limited to 'src/os.cpp')
| -rw-r--r-- | src/os.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/os.cpp b/src/os.cpp index b7d2fd1de0..d52295950d 100644 --- a/src/os.cpp +++ b/src/os.cpp @@ -225,6 +225,11 @@ void os_path_extname(Buf *full_path, Buf *out_basename, Buf *out_extname) { } void os_path_join(Buf *dirname, Buf *basename, Buf *out_full_path) { + if (buf_len(dirname) == 0) { + buf_init_from_buf(out_full_path, basename); + return; + } + buf_init_from_buf(out_full_path, dirname); uint8_t c = *(buf_ptr(out_full_path) + buf_len(out_full_path) - 1); if (!os_is_sep(c)) |
