aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/ijar/ijar.cc
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2016-12-02 15:11:08 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-12-02 19:08:53 +0000
commit479e18d7b2662bfa9b49de010fcc0942d5ae2d05 (patch)
tree757a4f259b37a0f83c59ce1e5785c9c33eeda977 /third_party/ijar/ijar.cc
parenta9a25ed309f45d61973ed284c101ec35eed20d20 (diff)
Ijar: can be compiled with MSVC
We can now build //third_party/ijar/...:all with --cpu=x64_windows_msvc. We also have to use --output_user_root=/c/tmp or something similarly short because //third_party/zlib tickles https://github.com/bazelbuild/bazel/issues/2145 This change takes us closer to compiling Bazel with MSVC. See https://github.com/bazelbuild/bazel/issues/2107 -- PiperOrigin-RevId: 140846600 MOS_MIGRATED_REVID=140846600
Diffstat (limited to 'third_party/ijar/ijar.cc')
-rw-r--r--third_party/ijar/ijar.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/third_party/ijar/ijar.cc b/third_party/ijar/ijar.cc
index 1f1c782879..af90fbbf3b 100644
--- a/third_party/ijar/ijar.cc
+++ b/third_party/ijar/ijar.cc
@@ -62,9 +62,10 @@ class JarStripperProcessor : public ZipExtractorProcessor {
};
bool JarStripperProcessor::Accept(const char* filename, const u4 attr) {
- ssize_t offset = strlen(filename) - CLASS_EXTENSION_LENGTH;
- if (offset >= 0) {
- return strcmp(filename + offset, CLASS_EXTENSION) == 0;
+ const int filename_len = strlen(filename);
+ if (filename_len >= CLASS_EXTENSION_LENGTH) {
+ return strcmp(filename + filename_len - CLASS_EXTENSION_LENGTH,
+ CLASS_EXTENSION) == 0;
}
return false;
}