From 8e714289cac55fd6f793cf21cea5fa1930edb985 Mon Sep 17 00:00:00 2001 From: Isaac Hier Date: Sun, 24 Jun 2018 20:27:18 -0400 Subject: [PATCH] Fix os_path_join for case where dirname is empty --- src/os.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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))