\r
\r
// Download a file \r
-char* PML_Download (pTree tree, const char* url, const char* server = "tree", const char* filename = NULL) \r
+char* PML_Download (pTree tree, const char* url, const char* server = "tree", const char* filename = "packmgr.xml") \r
{\r
UINT i;\r
static char downl [MAX_PATH]; // the full url\r
\r
else if(!strstr(filename, "\\"))\r
GetTempPathA (200, path);\r
+\r
+ else\r
+ strcpy(path, "");\r
+\r
\r
// create the local file name\r
if(filename)\r
DeleteFileA (path);\r
}\r
else\r
- GetTempFileNameA (path, "pml", 0, path); \r
+ GetTempFileNameA (path, "pml", 1, path); \r
\r
// get the url\r
if (!server)\r
\r
// is this a file link ?\r
if (strstr(downl, "file://") || strstr(downl, "File://"))\r
- {/*\r
- if(downl[strlen(downl)] == '\')\r
- downl[strlen(downl)] = '\0';\r
- */\r
+ {\r
if(!filename)\r
+ {\r
return &downl[7];\r
+ }\r
\r
else\r
{\r
}\r
}\r
\r
+\r
// download the file\r
if(URLDownloadToFileA (NULL, downl, path, 0, NULL) != S_OK)\r
{\r
\r
// download the file\r
if(strstr(url, "file://"))\r
- filename = PML_Download(tree, url, NULL);\r
+ filename = PML_Download(tree, url, NULL, NULL);\r
\r
else\r
filename = PML_Download(tree, url);\r
FILE* file = fopen(filename, "r");\r
if(!file) \r
{\r
- MessageBoxA(0,filename,0,0);\r
- Log("! ERROR: Could not open the xml file \"");\r
+ Log("! ERROR: Could not open the xml file ");\r
LogAdd(filename);\r
return ERR_GENERIC;\r
}\r