extern char * strstr(const char * , const char * );
+extern void * memcpy(void * , const void * , size_t size);
+
extern int toupper(int);
extern char * strcat(char * , const char * );
if(addedPath)
{
-char fileName[797] = "", archiveName[797] = "", * file;
+char fileName[797] = "", archiveName[797] = "", * file = (((void *)0));
int c = 0;
unsigned int isURL = 0x0;
+unsigned int isArchive = __ecereNameSpace__ecere__sys__SplitArchivePath(string, archiveName, &file);
char * urlFileName;
+char * protocolSymbol;
-if(__ecereNameSpace__ecere__sys__SplitArchivePath(string, archiveName, &file))
-strcpy(fileName, file);
-else
+strcpy(fileName, isArchive ? file : string);
+if(!isArchive)
{
-strcpy(fileName, string);
-}
-if(strstr(string, "http://") == string)
+protocolSymbol = (fileName[0] && fileName[0] != '.' && fileName[0] != '/' && fileName[0] != '\\' && fileName[1] != ':') ? strstr(fileName, "://") : (((void *)0));
+if(protocolSymbol)
{
-char * slash = strstr(fileName + 7, "/");
+char * slash = strstr(protocolSymbol + 3, "/");
isURL = 0x1;
if(slash)
else
urlFileName = fileName + strlen(fileName);
}
-if(strstr(addedPath, "http://") == addedPath)
+}
+protocolSymbol = (addedPath[0] && addedPath[0] != '.' && addedPath[0] != '/' && addedPath[0] != '\\' && addedPath[1] != ':') ? strstr(addedPath, "://") : (((void *)0));
+if(protocolSymbol)
{
-strcpy(fileName, "http://");
+int len = protocolSymbol - addedPath + 3;
+
+memcpy(fileName, addedPath, len);
+fileName[len] = (char)0;
isURL = 0x1;
-c = 7;
+c = len;
}
else if(__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1)
{
if(addedPath)
{
-char fileName[797] = "", archiveName[797] = "", * file;
+char fileName[797] = "", archiveName[797] = "", * file = (((void *)0));
int c = 0;
unsigned int isURL = 0x0;
+unsigned int isArchive = __ecereNameSpace__ecere__sys__SplitArchivePath(string, archiveName, &file);
char * urlFileName;
+char * protocolSymbol;
-if(__ecereNameSpace__ecere__sys__SplitArchivePath(string, archiveName, &file))
-strcpy(fileName, file);
-else
+strcpy(fileName, isArchive ? file : string);
+if(!isArchive)
{
-strcpy(fileName, string);
-}
-if(strstr(string, "http://") == string)
+protocolSymbol = (fileName[0] && fileName[0] != '.' && fileName[0] != '/' && fileName[0] != '\\' && fileName[1] != ':') ? strstr(fileName, "://") : (((void *)0));
+if(protocolSymbol)
{
-char * slash = strstr(fileName + 7, "/");
+char * slash = strstr(protocolSymbol + 3, "/");
isURL = 0x1;
if(slash)
else
urlFileName = fileName + strlen(fileName);
}
-if(strstr(addedPath, "http://") == addedPath)
+}
+protocolSymbol = (addedPath[0] && addedPath[0] != '.' && addedPath[0] != '/' && addedPath[0] != '\\' && addedPath[1] != ':') ? strstr(addedPath, "://") : (((void *)0));
+if(protocolSymbol)
{
-strcpy(fileName, "http://");
+int len = protocolSymbol - addedPath + 3;
+
+memcpy(fileName, addedPath, len);
+fileName[len] = (char)0;
isURL = 0x1;
-c = 7;
+c = len;
}
else if(runtimePlatform == 1)
{
string[c] = (char)0;
}
-extern void * memcpy(void * , const void * , size_t size);
-
char * __ecereNameSpace__ecere__sys__CopyString(char * string)
{
if(string)