Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

Merge with stable

Changeset e784e7be7bfc

Parents 5614b702e17c

Parents cba2f410d572

by Steve Borho

Changes to 2 files · Browse files at e784e7be7bfc Showing diff from parent 5614b702e17c cba2f410d572 Diff from another changeset...

 
47
48
49
50
51
52
 
 
 
 
 
 
53
54
55
 
47
48
49
 
 
 
50
51
52
53
54
55
56
57
58
@@ -47,9 +47,12 @@
 CRegStdBase::CRegStdBase (const tstring& key, bool force, HKEY base, REGSAM sam)   : CRegBaseCommon<tstring> (key, force, base, sam)  { - tstring::size_type pos = key.find_last_of(_T('\\')); - m_path = key.substr(0, pos); - m_key = key.substr(pos + 1); + tstring::size_type pos = key.find_last_of(_T('\\')); + if (pos != tstring::npos) + { + m_path = key.substr(0, pos); + m_key = key.substr(pos + 1); + }  }    //////////////////////////////////////////////////////////////////////////////////////////////
 
132
133
134
 
 
135
136
137
 
143
144
145
 
 
146
147
148
 
132
133
134
135
136
137
138
139
 
145
146
147
148
149
150
151
152
@@ -132,6 +132,8 @@
  if (filename.empty())   return filename;   std::string::size_type pos = filename.find_last_of("\\"); + if (pos == std::string::npos) + return "";   std::string myfilename = filename.substr(0, pos);   if (myfilename.size() > 0 && myfilename[myfilename.size()-1] == ':')   myfilename.push_back('\\'); @@ -143,6 +145,8 @@
  if (filename.empty())   return filename;   std::string::size_type pos = filename.find_last_of("\\"); + if (pos == std::string::npos) + return filename;   return filename.substr(pos+1);  }