Changeset a9cb537302bd…
Parent becac118cf9b…
by
Changes to 3 files · Browse files at a9cb537302bd Showing diff from parent becac118cf9b Diff from another changeset...
@@ -58,12 +58,9 @@
STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /* dwAttrib */)
{
- std::string mbstr = WideToMultibyte(pwszPath);
+ std::string path = WideToMultibyte(pwszPath);
- TDEBUG_TRACE("IsMemberOf: search for " << mbstr.c_str());
-
- char path[MAX_PATH] = "";
- strncat(path, mbstr.c_str(), MAX_PATH);
+ TDEBUG_TRACE("IsMemberOf: search for " << path);
std::string hgroot = GetHgRepoRoot(path);
@@ -78,13 +75,13 @@ size_t offset = hgroot.length();
if (path[offset] == '\\')
offset++;
- const char* relpathptr = path + offset;
+ const char* relpathptr = path.c_str() + offset;
std::string relpath = relpathptr;
char status = 0;
- if (PathIsDirectory(path))
+ if (PathIsDirectory(path.c_str()))
{
if (relpath.size() == 0)
return S_FALSE; // don't show icon on repo root dir
|
@@ -234,10 +234,10 @@
int HgQueryDirstate(
- const std::string& hgroot, const char* abspath, std::string& relpath,
+ const std::string& hgroot, const std::string& abspath, std::string& relpath,
const dirstate*& ppd, struct _stat& rstat)
{
- if (0 != lstat(abspath, rstat))
+ if (0 != lstat(abspath.c_str(), rstat))
{
TDEBUG_TRACE("HgQueryDirstate: lstat returns non-null");
return 0;
@@ -261,7 +261,7 @@
int HgQueryDirstateDirectory(
- const std::string& hgroot, const char* abspath,
+ const std::string& hgroot, const std::string& abspath,
std::string& relpath, char& outStatus)
{
const dirstate* pd = 0;
@@ -322,7 +322,7 @@
int HgQueryDirstateFile(
- const std::string& hgroot, const char* abspath,
+ const std::string& hgroot, const std::string& abspath,
std::string& relpath, char& outStatus)
{
const dirstate* pd = 0;
|
@@ -4,11 +4,11 @@ #include <string>
int HgQueryDirstateFile(
- const std::string& hgroot, const char* abspath,
+ const std::string& hgroot, const std::string& abspath,
std::string& relpath, char& outStatus);
int HgQueryDirstateDirectory(
- const std::string& hgroot, const char* abspath,
+ const std::string& hgroot, const std::string& abspath,
std::string& relpath, char& outStatus);
#endif
|
Loading...