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

dirstate.cpp: use std::string for path inside dirstate_get

Changeset 3425c24b4fa2

Parent 541224fdcdfa

by Adrian Buehlmann

Changes to one file · Browse files at 3425c24b4fa2 Showing diff from parent 541224fdcdfa Diff from another changeset...

 
157
158
159
160
 
 
 
161
162
163
164
165
166
 
167
168
169
170
171
172
 
173
174
175
 
187
188
189
190
 
191
192
193
 
157
158
159
 
160
161
162
163
164
 
 
 
 
165
166
167
168
169
170
 
171
172
173
174
 
186
187
188
 
189
190
191
192
@@ -157,19 +157,18 @@
 dirstatecache* _cache = NULL;  const dirstate* dirstate_get(const char* hgroot)  { - char path[MAX_PATH+1] = ""; + std::string path = hgroot; + path += "/.hg/dirstate"; +   struct _stat stat;   - strncat(path, hgroot, MAX_PATH); - strncat(path, "/.hg/dirstate", MAX_PATH); - - if (0 != lstat(path, &stat)) + if (0 != lstat(path.c_str(), &stat))   return NULL;     dirstatecache* head = _cache;   while (head)   { - if (strncmp(path, head->path.c_str(), MAX_PATH) == 0) + if (strncmp(path.c_str(), head->path.c_str(), MAX_PATH) == 0)   break;   head = head->next;   } @@ -187,7 +186,7 @@
  head->mtime = stat.st_mtime;   if (head->dstate)   delete head->dstate; - head->dstate = dirstate::read(path).release(); + head->dstate = dirstate::read(path.c_str()).release();   }     return head->dstate;