============ idFileSystemLocal::CreateOSPath Creates any directories needed to store the given filename ============ */
| 670 | ============ |
| 671 | */ |
| 672 | void idFileSystemLocal::CreateOSPath( const char *OSPath ) { |
| 673 | char *ofs; |
| 674 | |
| 675 | // make absolutely sure that it can't back up the path |
| 676 | // FIXME: what about c: ? |
| 677 | if ( strstr( OSPath, ".." ) || strstr( OSPath, "::" ) ) { |
| 678 | #ifdef _DEBUG |
| 679 | common->DPrintf( "refusing to create relative path \"%s\"\n", OSPath ); |
| 680 | #endif |
| 681 | return; |
| 682 | } |
| 683 | |
| 684 | idStr path( OSPath ); |
| 685 | for( ofs = &path[ 1 ]; *ofs ; ofs++ ) { |
| 686 | if ( *ofs == PATHSEPERATOR_CHAR ) { |
| 687 | // create the directory |
| 688 | *ofs = 0; |
| 689 | Sys_Mkdir( path ); |
| 690 | *ofs = PATHSEPERATOR_CHAR; |
| 691 | } |
| 692 | } |
| 693 | } |
| 694 | |
| 695 | /* |
| 696 | ================= |
no test coverage detected