mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Rewrite EDuke32's -d<demofile> option parsing code. Writing into argv[i]
isn't very wise. Also resize firstdemofile[] to BMAX_PATH bytes. git-svn-id: https://svn.eduke32.com/eduke32@2199 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
be84374899
commit
24e4d93226
3 changed files with 10 additions and 5 deletions
|
@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "menus.h"
|
#include "menus.h"
|
||||||
#include "savegame.h"
|
#include "savegame.h"
|
||||||
|
|
||||||
char firstdemofile[80];
|
char firstdemofile[BMAX_PATH];
|
||||||
|
|
||||||
FILE *g_demo_filePtr = (FILE *)NULL;
|
FILE *g_demo_filePtr = (FILE *)NULL;
|
||||||
int32_t g_demo_cnt;
|
int32_t g_demo_cnt;
|
||||||
|
|
|
@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#define __demo_h__
|
#define __demo_h__
|
||||||
|
|
||||||
extern FILE *g_demo_filePtr;
|
extern FILE *g_demo_filePtr;
|
||||||
extern char firstdemofile[80];
|
extern char firstdemofile[BMAX_PATH];
|
||||||
|
|
||||||
extern int32_t demoplay_diffs;
|
extern int32_t demoplay_diffs;
|
||||||
extern int32_t demoplay_showsync;
|
extern int32_t demoplay_showsync;
|
||||||
|
|
|
@ -8770,12 +8770,17 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
ud.m_coop--;
|
ud.m_coop--;
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
|
{
|
||||||
|
char *dot;
|
||||||
|
|
||||||
c++;
|
c++;
|
||||||
if (strchr(c,'.') == 0)
|
|
||||||
Bstrcat(c,".edm");
|
|
||||||
initprintf("Play demo %s.\n",c);
|
|
||||||
Bstrcpy(firstdemofile,c);
|
Bstrcpy(firstdemofile,c);
|
||||||
|
dot = Bstrchr(firstdemofile,'.');
|
||||||
|
if (!dot && Bstrlen(firstdemofile)+4 < sizeof(firstdemofile))
|
||||||
|
Bstrcat(firstdemofile,".edm");
|
||||||
|
initprintf("Play demo %s.\n",firstdemofile);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case 'g':
|
case 'g':
|
||||||
c++;
|
c++;
|
||||||
if (!*c) break;
|
if (!*c) break;
|
||||||
|
|
Loading…
Reference in a new issue