Skip to content

Commit

Permalink
Append a ';' delimiter in !pysymfix when the symbol path is already set.
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanCline committed Apr 14, 2019
1 parent 99c39ec commit 9c15915
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/pysymfix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ namespace {
throw runtime_error("SetSymbolPath failed with hr=" + hr);
}

string concatenatePaths(const string& path1, const string& path2, char delim = ';')
{
auto cattedPath = path1;
if (!cattedPath.empty() && cattedPath.back() != delim) {
cattedPath += delim;
}
cattedPath += path2;
return cattedPath;
}

}


Expand All @@ -50,7 +60,8 @@ namespace PyExt {

if (sympath.find("pythonsymbols.sdcline.com/symbols") == string::npos) {
Out("Adding symbol server to path...\n");
setSymbolPath(m_Symbols, sympath + "srv*http://pythonsymbols.sdcline.com/symbols");
const auto newPath = concatenatePaths(sympath, "srv*http://pythonsymbols.sdcline.com/symbols");
setSymbolPath(m_Symbols, newPath);
Out("New symbol path: %s\n", getSymbolPath(m_Symbols).c_str());
} else {
Out("Python symbol server already in path.\n");
Expand Down

0 comments on commit 9c15915

Please sign in to comment.