Added stock file_copy to file.inc.

Also fixed fopen to return 0 on files that can't be opened.
Fixed native fopen to take const filename.
This commit is contained in:
Johnny Bergström
2005-05-29 16:36:35 +00:00
parent c1552aacd6
commit 51ff0a2c49
2 changed files with 42 additions and 2 deletions

View File

@ -293,7 +293,13 @@ static cell AMX_NATIVE_CALL amx_fopen(AMX *amx, cell *params)
int len, j=-1;
char *file = build_pathname("%s", get_amxstring(amx, params[1], 1, len));
char *flags = get_amxstring(amx, params[2], 0, len);
FILE *fp = fopen(file, flags);
if (fp == NULL) {
// Failed
return 0;
}
for (i=0; i<FileList.size(); i++)
{
if (FileList.at(i) == NULL)