Index: lldb/source/Utility/TildeExpressionResolver.cpp =================================================================== --- lldb/source/Utility/TildeExpressionResolver.cpp +++ lldb/source/Utility/TildeExpressionResolver.cpp @@ -75,9 +75,8 @@ bool TildeExpressionResolver::ResolveFullPath( StringRef Expr, llvm::SmallVectorImpl &Output) { - Output.clear(); if (!Expr.startswith("~")) { - Output.append(Expr.begin(), Expr.end()); + Output.assign(Expr.begin(), Expr.end()); return false; } @@ -85,8 +84,10 @@ StringRef Left = Expr.take_until([](char c) { return path::is_separator(c); }); - if (!ResolveExact(Left, Output)) + if (!ResolveExact(Left, Output)) { + Output.assign(Expr.begin(), Expr.end()); return false; + } Output.append(Expr.begin() + Left.size(), Expr.end()); return true;