os/boardsupport/emulator/emulatorbsp/specific/property.cpp
changeset 1 260cb5ec6c19
parent 0 bde4ae8d615e
     1.1 --- a/os/boardsupport/emulator/emulatorbsp/specific/property.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.2 +++ b/os/boardsupport/emulator/emulatorbsp/specific/property.cpp	Tue Jun 10 14:32:02 2014 +0200
     1.3 @@ -28,6 +28,21 @@
     1.4  #define _DUMP_PROPERTY
     1.5  #endif
     1.6  
     1.7 +
     1.8 +//SL: added this to support relative paths
     1.9 +#include <stdio.h>
    1.10 +#ifdef WIN32
    1.11 +#include <direct.h>
    1.12 +#define GetCurrentDir _getcwd
    1.13 +#define FullPath _fullpath
    1.14 +#else
    1.15 +#include <unistd.h>
    1.16 +#define GetCurrentDir getcwd
    1.17 +#define FullPath fullpath
    1.18 +#endif
    1.19 +
    1.20 +
    1.21 +
    1.22  const char* KDefaultMachineName = "epoc";
    1.23  const char* KDefaultTestMachineName = "defaulttest";
    1.24  
    1.25 @@ -1164,6 +1179,7 @@
    1.26  	return mpath;
    1.27  	}
    1.28  
    1.29 +
    1.30  TInt Wins::SetupDrive(int aDrive, const char* aPath)
    1.31  //
    1.32  // set up emulated drives
    1.33 @@ -1208,8 +1224,15 @@
    1.34  
    1.35          }
    1.36      else
    1.37 -        // otherwise, aPath is fully qualified path name. Use that.
    1.38 -        return iProperties.Replace(prop, aPath) ? KErrNone : KErrNoMemory;
    1.39 +		{
    1.40 +		//Otherwise aPath is potentially a relative path
    1.41 +		char path[FILENAME_MAX+1];
    1.42 +		//Resolve relative path
    1.43 +		FullPath(path,aPath,sizeof(path)/sizeof(char));
    1.44 +        //Now path is fully qualified path name. Use that.
    1.45 +        return iProperties.Replace(prop, path) ? KErrNone : KErrNoMemory;
    1.46 +		}
    1.47 +
    1.48    
    1.49  	}
    1.50