Changeset 463 for CMT/HEAD/source/cmt_system.cxx
- Timestamp:
- Jul 18, 2008, 4:17:43 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.