Revert "Fix freeze when include file is a directory"
This reverts commit cebb44800ee81f0a71dc594a3f542df892134c0a.
This commit is contained in:
parent
cebb44800e
commit
67a29b927e
@ -124,19 +124,22 @@ SC_FUNC void clearstk(void)
|
|||||||
|
|
||||||
SC_FUNC int plungequalifiedfile(char *name)
|
SC_FUNC int plungequalifiedfile(char *name)
|
||||||
{
|
{
|
||||||
static char *extensions[] = { ".inc", ".p", ".pawn", "" };
|
static char *extensions[] = { ".inc", ".p", ".pawn" };
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char *ext;
|
char *ext;
|
||||||
int ext_idx;
|
int ext_idx;
|
||||||
|
|
||||||
ext_idx=0;
|
ext_idx=0;
|
||||||
do {
|
do {
|
||||||
|
fp=(FILE*)pc_opensrc(name);
|
||||||
ext=strchr(name,'\0'); /* save position */
|
ext=strchr(name,'\0'); /* save position */
|
||||||
/* try to append an extension */
|
if (fp==NULL) {
|
||||||
strcpy(ext,extensions[ext_idx]);
|
/* try to append an extension */
|
||||||
fp=pc_opensrc(name);
|
strcpy(ext,extensions[ext_idx]);
|
||||||
if (fp==NULL)
|
fp=(FILE*)pc_opensrc(name);
|
||||||
*ext='\0'; /* on failure, restore filename */
|
if (fp==NULL)
|
||||||
|
*ext='\0'; /* on failure, restore filename */
|
||||||
|
} /* if */
|
||||||
ext_idx++;
|
ext_idx++;
|
||||||
} while (fp==NULL && ext_idx<(sizeof extensions / sizeof extensions[0]));
|
} while (fp==NULL && ext_idx<(sizeof extensions / sizeof extensions[0]));
|
||||||
if (fp==NULL) {
|
if (fp==NULL) {
|
||||||
@ -3017,3 +3020,4 @@ static char itohstr[30];
|
|||||||
*ptr='\0'; /* and a zero-terminator */
|
*ptr='\0'; /* and a zero-terminator */
|
||||||
return itohstr;
|
return itohstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user