-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ".pwn" to the official list of extensions. #701
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -664,7 +664,7 @@ int pc_compile(int argc, char *argv[]) | |||||
if (strcmp(incfname,sDEF_PREFIX)==0) { | ||||||
plungefile(incfname,FALSE,TRUE); /* parse "default.inc" */ | ||||||
} else { | ||||||
if (!plungequalifiedfile(incfname)) /* parse "prefix" include file */ | ||||||
if (!plungequalifiedfile(incfname,1)) /* parse "prefix" include file */ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
error(100,incfname); /* cannot read from ... (fatal error) */ | ||||||
} /* if */ | ||||||
} /* if */ | ||||||
|
@@ -755,7 +755,7 @@ int pc_compile(int argc, char *argv[]) | |||||
if (strcmp(incfname,sDEF_PREFIX)==0) | ||||||
plungefile(incfname,FALSE,TRUE); /* parse "default.inc" (again) */ | ||||||
else | ||||||
plungequalifiedfile(incfname); /* parse implicit include file (again) */ | ||||||
plungequalifiedfile(incfname,1); /* parse implicit include file (again) */ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} /* if */ | ||||||
warnstack_init(); | ||||||
preprocess(); /* fetch first line */ | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -132,16 +132,17 @@ SC_FUNC void clearstk(void) | |||||
assert(stktop==0); | ||||||
} | ||||||
|
||||||
SC_FUNC int plungequalifiedfile(char *name) | ||||||
SC_FUNC int plungequalifiedfile(char *name,char new_extensions) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
{ | ||||||
static char extensions[][6] = { "", ".inc", ".p", ".pawn" }; | ||||||
unsigned int skipped_extensions=new_extensions?0:1; | ||||||
static char extensions[][6] = { "", ".inc", ".p", ".pawn", ".pwn"}; | ||||||
int found; | ||||||
struct stat st; | ||||||
FILE *fp; | ||||||
char *path; | ||||||
char *real_path; | ||||||
char *ext; | ||||||
int ext_idx; | ||||||
unsigned int ext_idx; | ||||||
|
||||||
fp=NULL; | ||||||
ext_idx=0; | ||||||
|
@@ -178,7 +179,7 @@ static char extensions[][6] = { "", ".inc", ".p", ".pawn" }; | |||||
found=FALSE; | ||||||
} /* if */ | ||||||
ext_idx++; | ||||||
} while (!found && ext_idx<arraysize(extensions)); | ||||||
} while (!found && ext_idx<arraysize(extensions)-skipped_extensions); | ||||||
if (!found) { | ||||||
*ext='\0'; /* restore filename */ | ||||||
free(path); | ||||||
|
@@ -227,7 +228,7 @@ SC_FUNC int plungefile(char *name,int try_currentpath,int try_includepaths) | |||||
int result=FALSE; | ||||||
|
||||||
if (try_currentpath) { | ||||||
result=plungequalifiedfile(name); | ||||||
result=plungequalifiedfile(name,0); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
if (!result) { | ||||||
/* failed to open the file in the active directory, try to open the file | ||||||
* in the same directory as the current file --but first check whether | ||||||
|
@@ -240,7 +241,7 @@ SC_FUNC int plungefile(char *name,int try_currentpath,int try_includepaths) | |||||
char path[_MAX_PATH]; | ||||||
strlcpy(path,inpfname,len+1); | ||||||
strlcat(path,name,arraysize(path)); | ||||||
result=plungequalifiedfile(path); | ||||||
result=plungequalifiedfile(path,1); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} /* if */ | ||||||
} /* if */ | ||||||
} /* if */ | ||||||
|
@@ -253,7 +254,7 @@ SC_FUNC int plungefile(char *name,int try_currentpath,int try_includepaths) | |||||
char path[_MAX_PATH]; | ||||||
strlcpy(path,ptr,arraysize(path)); | ||||||
strlcat(path,name,arraysize(path)); | ||||||
result=plungequalifiedfile(path); | ||||||
result=plungequalifiedfile(path,1); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} /* for */ | ||||||
} /* if */ | ||||||
return result; | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this codebase boolean values are usually stored in variables of type
int
. Not sure why, but still...