MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / TestIniFile

Function TestIniFile

src/Notepad2.c:5193–5220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5191 return ( 1 );
5192}
5193int TestIniFile()
5194{
5195 if ( lstrcmpi ( szIniFile, L"*?" ) == 0 ) {
5196 lstrcpy ( szIniFile2, L"" );
5197 lstrcpy ( szIniFile, L"" );
5198 return ( 0 );
5199 }
5200 if ( PathIsDirectory ( szIniFile ) || *CharPrev ( szIniFile, StrEnd ( szIniFile ) ) == L'\\' ) {
5201 WCHAR wchModule[MAX_PATH];
5202 GetModuleFileName ( NULL, wchModule, COUNTOF ( wchModule ) );
5203 PathAppend ( szIniFile, PathFindFileName ( wchModule ) );
5204 PathRenameExtension ( szIniFile, L".ini" );
5205 if ( !PathFileExists ( szIniFile ) ) {
5206 lstrcpy ( PathFindFileName ( szIniFile ), L"Notepad2.ini" );
5207 if ( !PathFileExists ( szIniFile ) ) {
5208 lstrcpy ( PathFindFileName ( szIniFile ), PathFindFileName ( wchModule ) );
5209 PathRenameExtension ( szIniFile, L".ini" );
5210 }
5211 }
5212 }
5213 if ( !PathFileExists ( szIniFile ) || PathIsDirectory ( szIniFile ) ) {
5214 lstrcpy ( szIniFile2, szIniFile );
5215 lstrcpy ( szIniFile, L"" );
5216 return ( 0 );
5217 } else {
5218 return ( 1 );
5219 }
5220}
5221int CreateIniFile()
5222{
5223 return ( CreateIniFileEx ( szIniFile ) );

Callers 1

WinMainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected