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,16 +1166,18 @@ typedef struct helppage_
|
||||||
helppage_t **helppage=NULL;
|
helppage_t **helppage=NULL;
|
||||||
int numhelppages=0;
|
int numhelppages=0;
|
||||||
|
|
||||||
static int emptyline(const char *start)
|
static int newpage(const char *start)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<80; i++)
|
for (i=0; i<80; i++)
|
||||||
{
|
{
|
||||||
if (start[i]=='\n' || !start[i]) break;
|
// if (start[i]=='\n' || !start[i]) break;
|
||||||
if (start[i]!=' ' && start[i]!='\t' && start[i]!='\r')
|
// if (start[i]!=' ' && start[i]!='\t' && start[i]!='\r')
|
||||||
return 0;
|
// return 0;
|
||||||
|
if (start[i] == '^' && start[i+1] == 'P')
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define IHELP_INITPAGES 32
|
#define IHELP_INITPAGES 32
|
||||||
|
@ -1207,7 +1209,7 @@ static void ReadHelpFile(const char *name)
|
||||||
pos = ftell(fp);
|
pos = ftell(fp);
|
||||||
Bfgets(tempbuf, 80, fp);
|
Bfgets(tempbuf, 80, fp);
|
||||||
charsread = ftell(fp)-pos;
|
charsread = ftell(fp)-pos;
|
||||||
if (!emptyline(tempbuf))
|
if (!newpage(tempbuf))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1256,7 +1258,7 @@ static void ReadHelpFile(const char *name)
|
||||||
j++;
|
j++;
|
||||||
|
|
||||||
}
|
}
|
||||||
while (!emptyline(tempbuf) && !Bfeof(fp) && charsread>0);
|
while (!newpage(tempbuf) && !Bfeof(fp) && charsread>0);
|
||||||
|
|
||||||
hp=realloc(hp, sizeof(helppage_t) + j*80);
|
hp=realloc(hp, sizeof(helppage_t) + j*80);
|
||||||
if (!hp) goto ERROR;
|
if (!hp) goto ERROR;
|
||||||
|
|
Loading…
Reference in a new issue