Fixed a forgotten hardcoded path
This commit is contained in:
parent
7c85530e92
commit
fdd2f3af33
|
@ -7,3 +7,4 @@ build*
|
|||
subprojects/lua
|
||||
subprojects/libagg
|
||||
sybprojects/lua
|
||||
lite
|
||||
|
|
|
@ -72,8 +72,7 @@ static void get_exe_filename(char *buf, int sz) {
|
|||
realpath(exepath, buf);
|
||||
#elif __amigaos4__
|
||||
#include "platform/amigaos4.h"
|
||||
// TODO: Add code to get the name of the executable
|
||||
strcpy(buf, _fullpath("PROGDIR:lite"));
|
||||
strcpy(buf, _fullpath("."));
|
||||
#else
|
||||
strcpy(buf, "./lite");
|
||||
#endif
|
||||
|
|
|
@ -8,41 +8,33 @@
|
|||
// TODO: check if this is set in SDK
|
||||
#define MAX_PATH_SIZE 255
|
||||
|
||||
char *_fullpath(const char *path)
|
||||
static char *getFullPath(const char *path)
|
||||
{
|
||||
//rintf("DBG: _fullpath() %s\n", path);
|
||||
char *appPath = malloc(sizeof(char) * MAX_PATH_SIZE);
|
||||
|
||||
if (strcmp(path, "."))
|
||||
BPTR pathLock = Lock(path, SHARED_LOCK);
|
||||
if (pathLock)
|
||||
{
|
||||
/*
|
||||
STRPTR appPath = AllocVecTags(sizeof(char) * MAX_PATH_SIZE,
|
||||
AVT_Type, MEMF_SHARED,
|
||||
AVT_ClearWithValue, "\0",
|
||||
TAG_DONE);
|
||||
*/
|
||||
char *appPath = malloc(sizeof(char) * MAX_PATH_SIZE);
|
||||
NameFromLock(pathLock, appPath, sizeof(char) * MAX_PATH_SIZE);
|
||||
UnLock(pathLock);
|
||||
|
||||
BPTR pathLock = Lock(path, SHARED_LOCK);
|
||||
if (pathLock)
|
||||
{
|
||||
//BPTR parentLock = ParentDir(pathLock);
|
||||
NameFromLock(pathLock, appPath, sizeof(char) * MAX_PATH_SIZE);
|
||||
|
||||
//printf("DBG: apppath %s\n", appPath);
|
||||
//UnLock(parentLock);
|
||||
UnLock(pathLock);
|
||||
|
||||
return appPath;
|
||||
//return "ram:";
|
||||
}
|
||||
//printf("DBG: pathLock failed\n");
|
||||
}
|
||||
|
||||
// TODO: Deal with . path
|
||||
if (!strcmp(path, "."))
|
||||
{
|
||||
//printf("DBG: return app folder\n");
|
||||
return "Applications:Programming/workspace/MyProjects/lite-xl_v1.16.12";
|
||||
return appPath;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *_fullpath(const char *path)
|
||||
{
|
||||
if (strcmp(path, "."))
|
||||
{
|
||||
return getFullPath(path);
|
||||
}
|
||||
|
||||
if (!strcmp(path, "."))
|
||||
{
|
||||
// TODO: Add code to get the name of the executable
|
||||
return getFullPath("PROGDIR:lite");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue