diff options
author | Simon Tatham <anakin@pobox.com> | 2017-05-18 07:03:04 +0100 |
---|---|---|
committer | Simon Tatham <anakin@pobox.com> | 2017-05-18 07:10:17 +0100 |
commit | 48919caa7b9fb99ba8196098c0ca2e1b3dae5160 (patch) | |
tree | 585312e8c0182016e99d8bb35ba12e1c1115ab09 /fake-winterop.c | |
parent | 69d886c5757e405785ce811d8622f4ff189a9514 (diff) | |
download | wix-on-linux-48919caa7b9fb99ba8196098c0ca2e1b3dae5160.tar.gz wix-on-linux-48919caa7b9fb99ba8196098c0ca2e1b3dae5160.tar.bz2 wix-on-linux-48919caa7b9fb99ba8196098c0ca2e1b3dae5160.zip |
Move dupcat out into its own file, and add dupstr.
Also a handy #define to replace all those tedious castings of NULL.
Diffstat (limited to '')
-rw-r--r-- | fake-winterop.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fake-winterop.c b/fake-winterop.c index b367831..6f7e3d3 100644 --- a/fake-winterop.c +++ b/fake-winterop.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <unistd.h> | 12 | #include <unistd.h> |
13 | 13 | ||
14 | #include "memory.h" | 14 | #include "memory.h" |
15 | #include "dupstr.h" | ||
15 | #include "fake-lib.h" | 16 | #include "fake-lib.h" |
16 | 17 | ||
17 | uint32_t HashPublicKeyInfo(void *pCertContext, | 18 | uint32_t HashPublicKeyInfo(void *pCertContext, |
@@ -41,13 +42,11 @@ uint32_t CreateCabBegin(const char16_t *wzCab, const char16_t *wzCabDir, | |||
41 | { | 42 | { |
42 | CabCreateContext *ctx = snew(CabCreateContext); | 43 | CabCreateContext *ctx = snew(CabCreateContext); |
43 | ctx->outdir = ascii(wzCabDir, true); | 44 | ctx->outdir = ascii(wzCabDir, true); |
44 | ctx->outfile = dupcat(ctx->outdir, "/", | 45 | ctx->outfile = dupcat(ctx->outdir, "/", ascii(wzCab, true), cNULL); |
45 | ascii(wzCab, true), (const char *)NULL); | ||
46 | ctx->nargs = 0; | 46 | ctx->nargs = 0; |
47 | ctx->argsize = 16; | 47 | ctx->argsize = 16; |
48 | ctx->args = snewn(ctx->argsize, char *); | 48 | ctx->args = snewn(ctx->argsize, char *); |
49 | ctx->args[ctx->nargs++] = dupcat(getenv("WIX"), "/", "makecab.py", | 49 | ctx->args[ctx->nargs++] = dupcat(getenv("WIX"), "/", "makecab.py", cNULL); |
50 | (const char *)NULL); | ||
51 | ctx->args[ctx->nargs++] = ctx->outfile; | 50 | ctx->args[ctx->nargs++] = ctx->outfile; |
52 | *out_ctx = ctx; | 51 | *out_ctx = ctx; |
53 | return 0; | 52 | return 0; |
@@ -104,7 +103,7 @@ uint32_t ExtractCab(const char16_t *wzCabinet, const char16_t *wzExtractDir) | |||
104 | { | 103 | { |
105 | char *cab = ascii(wzCabinet, true), *dir = ascii(wzExtractDir, true); | 104 | char *cab = ascii(wzCabinet, true), *dir = ascii(wzExtractDir, true); |
106 | fprintf(stderr, "ExtractCab(\"%s\", \"%s\"\n", cab, dir); | 105 | fprintf(stderr, "ExtractCab(\"%s\", \"%s\"\n", cab, dir); |
107 | system_argv("cabextract", "-d", dir, cab, (const char *)NULL); | 106 | system_argv("cabextract", "-d", dir, cab, cNULL); |
108 | return 0; | 107 | return 0; |
109 | } | 108 | } |
110 | 109 | ||