mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 22:51:57 +00:00
fopen mode 4 = whole file (fgets doesn't stop on new lines)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3561 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
48457fdfec
commit
6b48d670ac
1 changed files with 4 additions and 2 deletions
|
@ -523,6 +523,7 @@ void PF_fopen (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
switch (fmode)
|
||||
{
|
||||
case 0: //read
|
||||
case 4: //read whole file
|
||||
pf_fopen_files[i].data = FS_LoadMallocFile(pf_fopen_files[i].name);
|
||||
if (!pf_fopen_files[i].data)
|
||||
{
|
||||
|
@ -590,6 +591,7 @@ void PF_fclose_i (int fnum)
|
|||
switch(pf_fopen_files[fnum].accessmode)
|
||||
{
|
||||
case 0:
|
||||
case 4:
|
||||
BZ_Free(pf_fopen_files[fnum].data);
|
||||
break;
|
||||
case 1:
|
||||
|
@ -657,9 +659,9 @@ void PF_fgets (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
while(s < eof)
|
||||
{
|
||||
c = *s++;
|
||||
if (c == '\n')
|
||||
if (c == '\n' && pf_fopen_files[fnum].accessmode != 4)
|
||||
break;
|
||||
if (c == '\r')
|
||||
if (c == '\r' && pf_fopen_files[fnum].accessmode != 4)
|
||||
continue;
|
||||
|
||||
if (o == max)
|
||||
|
|
Loading…
Reference in a new issue