Expand the full file name for incomplete or relative paths in Windows. Notice the API doesn't guarantee that the resulting path and filename are valid. In this regard, our custom ShortToLongPathName() is more thorough, although it produces different results, because it skips "." and ".." in the path.
| 1324 | // In this regard, our custom ShortToLongPathName() is more thorough, although |
| 1325 | // it produces different results, because it skips "." and ".." in the path. |
| 1326 | static bool get_full_path(const tstring& part, tstring& full) |
| 1327 | { |
| 1328 | TEXT buf[MAXPATHLEN]; |
| 1329 | TEXT *p; |
| 1330 | const int l = GetFullPathName(part.c_str(), MAXPATHLEN, buf, &p); |
| 1331 | if (l && l < MAXPATHLEN) |
| 1332 | { |
| 1333 | full = buf; |
| 1334 | return true; |
| 1335 | } |
| 1336 | |
| 1337 | return false; |
| 1338 | } |
| 1339 | #endif |
| 1340 | |
| 1341 |
no test coverage detected