mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
use ^P instead of blank lines to designate a new page in help files
git-svn-id: https://svn.eduke32.com/eduke32@784 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
41cfe16a61
commit
fa6cb48383
1 changed files with 9 additions and 7 deletions
|
@ -1166,17 +1166,19 @@ typedef struct helppage_
|
|||
helppage_t **helppage=NULL;
|
||||
int numhelppages=0;
|
||||
|
||||
static int emptyline(const char *start)
|
||||
static int newpage(const char *start)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<80; i++)
|
||||
{
|
||||
if (start[i]=='\n' || !start[i]) break;
|
||||
if (start[i]!=' ' && start[i]!='\t' && start[i]!='\r')
|
||||
return 0;
|
||||
}
|
||||
// if (start[i]=='\n' || !start[i]) break;
|
||||
// if (start[i]!=' ' && start[i]!='\t' && start[i]!='\r')
|
||||
// return 0;
|
||||
if (start[i] == '^' && start[i+1] == 'P')
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define IHELP_INITPAGES 32
|
||||
#define IHELP_INITLINES 16
|
||||
|
@ -1207,7 +1209,7 @@ static void ReadHelpFile(const char *name)
|
|||
pos = ftell(fp);
|
||||
Bfgets(tempbuf, 80, fp);
|
||||
charsread = ftell(fp)-pos;
|
||||
if (!emptyline(tempbuf))
|
||||
if (!newpage(tempbuf))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -1256,7 +1258,7 @@ static void ReadHelpFile(const char *name)
|
|||
j++;
|
||||
|
||||
}
|
||||
while (!emptyline(tempbuf) && !Bfeof(fp) && charsread>0);
|
||||
while (!newpage(tempbuf) && !Bfeof(fp) && charsread>0);
|
||||
|
||||
hp=realloc(hp, sizeof(helppage_t) + j*80);
|
||||
if (!hp) goto ERROR;
|
||||
|
|
Loading…
Reference in a new issue