<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> // Strip the directory and suffix from BaseInput.<br>
-static const char *getBaseName (const char *BaseInput) {<br>
+static std::string getBaseName (const char *BaseInput) {<br>
   std::pair<StringRef, StringRef> Split = StringRef(BaseInput).rsplit('/');<br>
   if (Split.second != "")<br>
-    return Split.second.split('.').first.str().c_str();<br>
+    return Split.second.split('.').first.str();<br>
   else<br>
-    return Split.first.split('.').first.str().c_str();<br>
+    return Split.first.split('.').first.str();<br>
 }<br><br></blockquote><div><br></div><div>Shouldn't this just return StringRef instead? what's the reason you're converting to std::string at all here?</div><div><br></div><div>- David </div></div>