Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

dirstate: use std::string for abspath params

Changeset a9cb537302bd

Parent becac118cf9b

by Adrian Buehlmann

Changes to 3 files · Browse files at a9cb537302bd Showing diff from parent becac118cf9b Diff from another changeset...

 
58
59
60
61
 
62
63
64
65
66
 
67
68
69
 
78
79
80
81
 
82
83
84
85
86
87
 
88
89
90
 
58
59
60
 
61
62
 
 
 
 
63
64
65
66
 
75
76
77
 
78
79
80
81
82
83
 
84
85
86
87
@@ -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
235
236
237
 
238
239
240
 
241
242
243
 
261
262
263
264
 
265
266
267
 
322
323
324
325
 
326
327
328
 
234
235
236
 
237
238
239
 
240
241
242
243
 
261
262
263
 
264
265
266
267
 
322
323
324
 
325
326
327
328
@@ -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
5
6
7
 
8
9
10
11
 
12
13
14
 
4
5
6
 
7
8
9
10
 
11
12
13
14
@@ -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