changed the basedir search routine
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@94
This commit is contained in:
parent
9e6f36a09b
commit
c603dedc52
1 changed files with 6 additions and 4 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "dosbox.h"
|
||||
#include "debug.h"
|
||||
#include "cpu.h"
|
||||
|
@ -243,10 +244,11 @@ static void InitSystems(void) {
|
|||
|
||||
void DOSBOX_Init(int argc, char* argv[]) {
|
||||
/* Find the base directory */
|
||||
strcpy(dosbox_basedir,argv[0]);
|
||||
char * last=strrchr(dosbox_basedir,CROSS_FILESPLIT); //if windowsversion fails:
|
||||
if (!last) E_Exit("Can't find basedir %s", argv[0]);
|
||||
*++last=0;
|
||||
getcwd(dosbox_basedir,CROSS_LEN);
|
||||
char a[2];
|
||||
a[0]=CROSS_FILESPLIT;
|
||||
a[1]='\0';
|
||||
strcat(dosbox_basedir,a);
|
||||
/* Parse the command line with a setup function */
|
||||
int argl=1;
|
||||
if (argc>1) {
|
||||
|
|
Loading…
Add table
Reference in a new issue