Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CFile: Handle paths like "~/foo"

This let's CFile expand relative-to-home paths. I "accidentally" broke
ISpoofFile with some recent commit and that is now fixed with this. This should
solve this problem for quite a lot of other places, too.

Idea (c) by DarthGandalf, thanks. :)

Signed-off-by: Uli Schlachter <psychon@znc.in>
  • Loading branch information...
commit cb2e50a5bd79697c3299d50d5e2596821d87fa62 1 parent ce10cee
@psychon psychon authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 FileUtils.cpp
View
5 FileUtils.cpp
@@ -37,7 +37,10 @@ CFile::~CFile() {
}
void CFile::SetFileName(const CString& sLongName) {
- m_sLongName = sLongName;
+ if (sLongName.Left(2) == "~/") {
+ m_sLongName = CZNC::Get().GetHomePath() + sLongName.substr(1);
+ } else
+ m_sLongName = sLongName;
m_sShortName = sLongName;
m_sShortName.TrimRight("/");
Please sign in to comment.
Something went wrong with that request. Please try again.