diff options
author | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2009-03-31 23:59:07 +0000 |
---|---|---|
committer | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2009-03-31 23:59:07 +0000 |
commit | 15f01647e8854d2f21bfb9a6310b7aeb4cad3e47 (patch) | |
tree | 8c8e180a75a14d918246d579a5cbf6e8089b2e23 | |
parent | 99d21912f00a44a6bb83e9bb3ae248facb235b69 (diff) |
added pescuma's version string patch (thx)
version bump
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@453 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r-- | updater/socket.cpp | 22 | ||||
-rw-r--r-- | updater/version.h | 4 |
2 files changed, 24 insertions, 2 deletions
diff --git a/updater/socket.cpp b/updater/socket.cpp index d066a9d..7e5db53 100644 --- a/updater/socket.cpp +++ b/updater/socket.cpp @@ -81,6 +81,28 @@ bool GetFile(char *url, TCHAR *temp_folder, char *plugin_name, char *version, bo ext = ".zip";
}
+ // replace version text in URL
+ char tmp_url[1024];
+ if (version != NULL) {
+ char *p;
+ size_t pos = 0;
+ size_t version_len = strlen(version);
+ while ((p = strstr(url, "%VERSION%")) != NULL && (p - url + version_len < sizeof(tmp_url) - 1)) {
+ strncpy(&tmp_url[pos], url, p - url);
+ pos += p - url;
+ strcpy(&tmp_url[pos], version);
+ pos += version_len;
+ url += p - url + 9; // 9 == strlen("%VERSION%")
+ }
+ if (strlen(url) < sizeof(tmp_url) - 1) {
+ strcpy(&tmp_url[pos], url);
+ pos += strlen(url);
+ }
+ tmp_url[pos] = 0;
+ url = tmp_url;
+ }
+
+
NETLIBHTTPREQUEST req = {0};
req.cbSize = sizeof(req);
diff --git a/updater/version.h b/updater/version.h index 37e1d0b..68db7e3 100644 --- a/updater/version.h +++ b/updater/version.h @@ -4,8 +4,8 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 5
-#define __RELEASE_NUM 4
-#define __BUILD_NUM 3
+#define __RELEASE_NUM 5
+#define __BUILD_NUM 0
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
|