From 96bece4cca08feb2f56664953fbba8e0412bc3ef Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Mon, 14 Jul 2003 08:41:52 +0000 Subject: [PATCH] Remove usage of HostPt while going through environment strings. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1124 --- src/misc/programs.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/misc/programs.cpp b/src/misc/programs.cpp index 2fcaedb2..111699da 100644 --- a/src/misc/programs.cpp +++ b/src/misc/programs.cpp @@ -80,14 +80,16 @@ Program::Program() { /* Find the command line and setup the PSP */ psp = new DOS_PSP(dos.psp); /* Scan environment for filename */ - char * envscan=(char *)HostMake(psp->GetEnvironment(),0); - while (*envscan) envscan+=strlen(envscan)+1; + PhysPt envscan=PhysMake(psp->GetEnvironment(),0); + while (mem_readb(envscan)) envscan+=mem_strlen(envscan)+1; envscan+=3; CommandTail tail; MEM_BlockRead(PhysMake(dos.psp,128),&tail,128); if (tail.count<127) tail.buffer[tail.count]=0; else tail.buffer[126]=0; - cmd = new CommandLine(envscan,tail.buffer); + char filename[256]; + MEM_StrCopy(envscan,filename,256); + cmd = new CommandLine(filename,tail.buffer); } void Program::WriteOut(const char * format,...) {