Changeset 463
- Timestamp:
- Jul 18, 2008, 4:17:43 PM (16 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r462 r463 1 2008-07-18 <rybkin@lal.in2p3.fr> 364 2 3 * source/cmt_system.cxx: In the CmtSystem::compress_path function, add the 4 replacement of "/.." with "/" (one cannot walk down past the root), more 5 careful treatment of some boundary cases 6 * source/cmt_parser.cxx: Add 2 debug level messages in the function 7 Cmt::guess_current_project 8 1 9 2008-06-25 <rybkin@lal.in2p3.fr> 363 2 10 -
CMT/HEAD/source/cmt_parser.cxx
r461 r463 4565 4565 if (!CmtSystem::cd ("..")) 4566 4566 { 4567 log << "Cannot cd up..." << log_endl; 4567 4568 break; 4568 4569 } … … 4570 4571 if (CmtSystem::pwd () == pwd) 4571 4572 { 4573 log << "Looks the same pwd..." << log_endl; 4572 4574 break; 4573 4575 } -
CMT/HEAD/source/cmt_system.cxx
r459 r463 2138 2138 // xxxx does not contain any macro reference 2139 2139 // 2140 // Also replace "/.." with "/". One cannot walk down past the root. 2140 2141 //---------------------------------------------------------- 2141 2142 void CmtSystem::compress_path (cmt_string& dir) … … 2169 2170 for (;;) 2170 2171 { 2172 int pos0 (0); 2171 2173 int pos1; 2172 2174 int pos2; 2173 2175 int pos3; 2174 2176 2175 pos1 = dir.find (pattern); 2177 //pos1 = dir.find (pattern); 2178 //if (pos1 == cmt_string::npos) break; 2179 2180 do 2181 { 2182 pos1 = dir.find (pos0, pattern); 2183 if (pos1 == cmt_string::npos) break; 2184 pos0 = pos1 + 3; 2185 } 2186 while (pos0 < dir.size () && dir[pos0] != file_separator ()); 2187 2176 2188 if (pos1 == cmt_string::npos) break; 2189 2190 // 2191 // One cannot walk down past the root: "/.." is the same as "/". 2192 // 2193 #ifdef WIN32 2194 if (pos1 == 0) 2195 { 2196 dir.erase (pos1, 3); 2197 if (dir == "") 2198 dir = file_separator (); 2199 continue; 2200 } 2201 else if (pos1 == 2 && dir[1] == ':') 2202 { 2203 dir.erase (pos1, 3); 2204 if (dir.size () == 2) 2205 dir += file_separator (); 2206 continue; 2207 } 2208 #else 2209 if (pos1 == 0) 2210 { 2211 dir.erase (pos1, 3); 2212 if (dir == "") 2213 dir = file_separator (); 2214 continue; 2215 } 2216 #endif 2177 2217 2178 2218 // … … 2224 2264 { 2225 2265 dir.erase (pos2, pos1 + 3 - pos2); 2266 #ifdef WIN32 2267 if (dir == "") 2268 { 2269 dir = file_separator (); 2270 } 2271 else if (dir.size () == 2 && dir[1] == ':') 2272 { 2273 dir += file_separator (); 2274 } 2275 #else 2276 if (dir == "") 2277 dir = file_separator (); 2278 #endif 2226 2279 } 2227 2280 else
Note: See TracChangeset
for help on using the changeset viewer.