================ idProgram::GetFilenum ================ */
| 2172 | ================ |
| 2173 | */ |
| 2174 | int idProgram::GetFilenum( const char *name ) { |
| 2175 | if ( filename == name ) { |
| 2176 | return filenum; |
| 2177 | } |
| 2178 | |
| 2179 | idStr strippedName; |
| 2180 | strippedName = fileSystem->OSPathToRelativePath( name ); |
| 2181 | if ( !strippedName.Length() ) { |
| 2182 | // not off the base path so just use the full path |
| 2183 | filenum = fileList.AddUnique( name ); |
| 2184 | } else { |
| 2185 | filenum = fileList.AddUnique( strippedName ); |
| 2186 | } |
| 2187 | |
| 2188 | // save the unstripped name so that we don't have to strip the incoming name every time we call GetFilenum |
| 2189 | filename = name; |
| 2190 | |
| 2191 | return filenum; |
| 2192 | } |
| 2193 | |
| 2194 | /* |
| 2195 | ================ |
no test coverage detected