Skip to content
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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Add ".pwn" to the official list of extensions. #701

wants to merge 2 commits into from

Conversation

Y-Less
Copy link
Member

@Y-Less Y-Less commented Mar 11, 2022

What this PR does / why we need it:

Adds ".pwn" to the list of include extensions. It is used by almost all scripts, so why shouldn't it be officially supported?

Which issue(s) this PR fixes:

Fixes #

What kind of pull this is:

  • A Bug Fix
  • A New Feature
  • Some repository meta (documentation, etc)
  • Other

Additional Documentation:

It is used by almost all scripts, so why shouldn't it be officially supported?
@Y-Less Y-Less requested a review from a team as a code owner March 11, 2022 10:45
@@ -727,7 +727,7 @@ SC_FUNC cell do_static_check(int use_warning);
SC_FUNC void pushstk(stkitem val);
SC_FUNC stkitem popstk(void);
SC_FUNC void clearstk(void);
SC_FUNC int plungequalifiedfile(char *name); /* explicit path included */
SC_FUNC int plungequalifiedfile(char *name,char new_extensions); /* explicit path included */
Copy link
Contributor

@Daniel-Cortez Daniel-Cortez Jun 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SC_FUNC int plungequalifiedfile(char *name,char new_extensions); /* explicit path included */
SC_FUNC int plungequalifiedfile(char *name,int new_extensions); /* explicit path included */

In this codebase boolean values are usually stored in variables of type int. Not sure why, but still...

@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SC_FUNC int plungequalifiedfile(char *name,char new_extensions)
SC_FUNC int plungequalifiedfile(char *name,int new_extensions)

@@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
result=plungequalifiedfile(name,0);
result=plungequalifiedfile(name,FALSE);

@@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
result=plungequalifiedfile(path,1);
result=plungequalifiedfile(path,TRUE);

@@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
result=plungequalifiedfile(path,1);
result=plungequalifiedfile(path,TRUE);

@@ -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 */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!plungequalifiedfile(incfname,1)) /* parse "prefix" include file */
if (!plungequalifiedfile(incfname,TRUE)) /* parse "prefix" include file */

@@ -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) */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
plungequalifiedfile(incfname,1); /* parse implicit include file (again) */
plungequalifiedfile(incfname,TRUE); /* parse implicit include file (again) */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants