From c603dedc52c4c2acd27218970f4c8f9313132db3 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Mon, 29 Jul 2002 14:06:51 +0000 Subject: [PATCH] changed the basedir search routine Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@94 --- src/dosbox.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dosbox.cpp b/src/dosbox.cpp index 735491be..72f10c67 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #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) {