Reduce the scope of variables

This commit is contained in:
Luis Díaz Más
2018-11-06 18:58:39 +01:00
parent dc7eb5008b
commit 2d1e1fe6ef
4 changed files with 71 additions and 41 deletions
+6 -4
View File
@@ -656,12 +656,14 @@ int readFile(const char* path,Options /* options */)
FILE* f = fopen(path,"r");
int nResult = f ? typeFile : typeUnknown;
if ( f ) {
const char* docs[] = { ".doc",".txt", NULL };
const char* code[] = { ".cpp",".h" ,".pl" ,".py" ,".pyc", NULL };
const char* ext = strstr(path,".");
if ( ext ) {
if ( sina(ext,docs) ) nResult = typeDoc;
if ( sina(ext,code) ) nResult = typeCode;
const char* docs[] = { ".doc",".txt", NULL };
const char* code[] = { ".cpp",".h" ,".pl" ,".py" ,".pyc", NULL };
if ( sina(ext,docs) )
nResult = typeDoc;
if ( sina(ext,code) )
nResult = typeCode;
}
}
if ( f ) fclose(f) ;