aboutsummaryrefslogtreecommitdiff
path: root/fake-lib.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-05-16 19:06:37 +0100
committerSimon Tatham <anakin@pobox.com>2017-05-16 19:06:37 +0100
commitaf3d986af771c8ce6401df5dd69504fb350c7de9 (patch)
treee1ab5557a1308d82fafaec1f925d89549a686c0d /fake-lib.c
parentf0cdcb370ec7023428bc421e3a8b5f5cbf1de502 (diff)
downloadwix-on-linux-af3d986af771c8ce6401df5dd69504fb350c7de9.tar.gz
wix-on-linux-af3d986af771c8ce6401df5dd69504fb350c7de9.tar.bz2
wix-on-linux-af3d986af771c8ce6401df5dd69504fb350c7de9.zip
Implement MsiGetFileVersion.
This is pretty ugly code, but it works well enough to deliver the right versions for the files in my test MSI. I can polish it later.
Diffstat (limited to 'fake-lib.c')
-rw-r--r--fake-lib.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fake-lib.c b/fake-lib.c
index 2207ce3..011d35d 100644
--- a/fake-lib.c
+++ b/fake-lib.c
@@ -128,3 +128,15 @@ char *dupcat(const char *str, ...)
128 128
129 return out; 129 return out;
130} 130}
131
132unsigned le(const unsigned char *buf, size_t len, size_t off, size_t nbytes)
133{
134 unsigned toret = 0;
135 off += nbytes;
136 while (nbytes-- > 0) {
137 toret <<= 8;
138 if (--off < len)
139 toret |= buf[off];
140 }
141 return toret;
142}