Fossil SCM
On windows, use the global variable _pgmptr instead of <nowiki>argv[0]</nowiki> in order to find the name of the current executable. Ticket [c8c0b78c840e4df9]
Commit
23a3adac3937b26e4df718fda2e11827abc51eaa
Parent
8f41b2fa75f9308…
1 file changed
+1
-1
+1
-1
| --- src/winhttp.c | ||
| +++ src/winhttp.c | ||
| @@ -106,11 +106,11 @@ | ||
| 106 | 106 | wanted -= got; |
| 107 | 107 | } |
| 108 | 108 | fclose(out); |
| 109 | 109 | out = 0; |
| 110 | 110 | sprintf(zCmd, "\"%s\" http \"%s\" %s %s %s%s", |
| 111 | - g.argv[0], g.zRepositoryName, zRequestFName, zReplyFName, | |
| 111 | + _pgmptr, g.zRepositoryName, zRequestFName, zReplyFName, | |
| 112 | 112 | inet_ntoa(p->addr.sin_addr), p->zNotFound |
| 113 | 113 | ); |
| 114 | 114 | portable_system(zCmd); |
| 115 | 115 | in = fopen(zReplyFName, "rb"); |
| 116 | 116 | if( in ){ |
| 117 | 117 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -106,11 +106,11 @@ | |
| 106 | wanted -= got; |
| 107 | } |
| 108 | fclose(out); |
| 109 | out = 0; |
| 110 | sprintf(zCmd, "\"%s\" http \"%s\" %s %s %s%s", |
| 111 | g.argv[0], g.zRepositoryName, zRequestFName, zReplyFName, |
| 112 | inet_ntoa(p->addr.sin_addr), p->zNotFound |
| 113 | ); |
| 114 | portable_system(zCmd); |
| 115 | in = fopen(zReplyFName, "rb"); |
| 116 | if( in ){ |
| 117 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -106,11 +106,11 @@ | |
| 106 | wanted -= got; |
| 107 | } |
| 108 | fclose(out); |
| 109 | out = 0; |
| 110 | sprintf(zCmd, "\"%s\" http \"%s\" %s %s %s%s", |
| 111 | _pgmptr, g.zRepositoryName, zRequestFName, zReplyFName, |
| 112 | inet_ntoa(p->addr.sin_addr), p->zNotFound |
| 113 | ); |
| 114 | portable_system(zCmd); |
| 115 | in = fopen(zReplyFName, "rb"); |
| 116 | if( in ){ |
| 117 |