<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8000001907349px">GetPath() is supposed to have not put a trailing slash in that case.</span></blockquote><div> </div>But it should (the only case in which it should). `'/'`(root directory) is not the same as an empty (invalid) path.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 27, 2015 at 4:11 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">GetPath() is supposed to have not put a trailing slash in that case. See the call to rtrim() in GetPath()<br><div class="gmail_quote">On Wed, May 27, 2015 at 3:14 PM Chaoren Lin <<a href="mailto:chaorenl@google.com" target="_blank">chaorenl@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">================<br>
Comment at: source/Host/common/FileSpec.cpp:630<br>
@@ +629,3 @@<br>
+ std::string path = GetPath();<br>
+ if (!m_filename && !path.empty())<br>
+ path.push_back(GetPathSeparator());<br>
----------------<br>
What if `path == "/"`?<br>
<br>
================<br>
Comment at: source/Host/common/FileSpec.cpp:844<br>
@@ +843,3 @@<br>
+ {<br>
+ if (m_directory)<br>
+ path.push_back('/');<br>
----------------<br>
What if `m_directory == '/'`? We'd get `//filename`.<span class=""><br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D9942&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=_Iq7oStl_SObCv_51Je1yL3ZyfyRnSKl4a9PNrQMClA&s=fXPgOyFkifWNzQZYqGsfWNvodBeS012eFXbX9HduZrg&e=" target="_blank">http://reviews.llvm.org/D9942</a><br>
<br>
EMAIL PREFERENCES<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_settings_panel_emailpreferences_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=MEqT8U_n7oNfuDW5NRbY3ZV384ZquXIYFPWmprwUdKM&m=_Iq7oStl_SObCv_51Je1yL3ZyfyRnSKl4a9PNrQMClA&s=uYYSmLZ-nN1h0UXnD-qycXsT8WTg0M_NWXY09R737xA&e=" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</span></blockquote></div>
</blockquote></div><br></div>