Commit 75133f8 for zlib
commit 75133f8599b7b4509db50e673c66a42c1da1be03
Author: Mark Adler <git@madler.net>
Date: Wed Jan 28 13:47:47 2026 -0800
Replace // with /* comments in minizip zip.c.
diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c
index b6c7550..2ec886c 100644
--- a/contrib/minizip/zip.c
+++ b/contrib/minizip/zip.c
@@ -1247,32 +1247,32 @@ local int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt s
return err;
}
-// Return the length of the UTF-8 code at str[0..len-1] in [1..4], or negative
-// if there is no valid UTF-8 code there. If negative, it is minus the number
-// of bytes examined in order to determine it was bad. Or if minus the return
-// code is one less than len, then at least one more byte than provided would
-// be needed to complete the code.
+/* Return the length of the UTF-8 code at str[0..len-1] in [1..4], or negative
+ if there is no valid UTF-8 code there. If negative, it is minus the number
+ of bytes examined in order to determine it was bad. Or if minus the return
+ code is one less than len, then at least one more byte than provided would
+ be needed to complete the code. */
local int utf8len(unsigned char const *str, size_t len) {
return
- len == 0 ? -1 : // empty input
- str[0] < 0x80 ? 1 : // good one-byte
- str[0] < 0xc0 ? -1 : // bad first byte
- len < 2 || (str[1] >> 6) != 2 ? -2 : // missing or bad second byte
- str[0] < 0xc2 ? -2 : // overlong code
- str[0] < 0xe0 ? 2 : // good two-byte
- len < 3 || (str[2] >> 6) != 2 ? -3 : // missing or bad third byte
- str[0] == 0xe0 && str[1] < 0xa0 ? -3 : // overlong code
- str[0] < 0xf0 ? 3 : // good three-byte
- len < 4 || (str[3] >> 6) != 2 ? -4 : // missing or bad fourth byte
- str[0] == 0xf0 && str[1] < 0x90 ? -4 : // overlong code
+ len == 0 ? -1 : /* empty input */
+ str[0] < 0x80 ? 1 : /* good one-byte */
+ str[0] < 0xc0 ? -1 : /* bad first byte */
+ len < 2 || (str[1] >> 6) != 2 ? -2 : /* missing or bad 2nd byte */
+ str[0] < 0xc2 ? -2 : /* overlong code */
+ str[0] < 0xe0 ? 2 : /* good two-byte */
+ len < 3 || (str[2] >> 6) != 2 ? -3 : /* missing or bad 3rd byte */
+ str[0] == 0xe0 && str[1] < 0xa0 ? -3 : /* overlong code */
+ str[0] < 0xf0 ? 3 : /* good three-byte */
+ len < 4 || (str[3] >> 6) != 2 ? -4 : /* missing or bad 4th byte */
+ str[0] == 0xf0 && str[1] < 0x90 ? -4 : /* overlong code */
str[0] < 0xf4 ||
- (str[0] == 0xf4 && str[1] < 0x90) ? 4 : // good four-byte
- -4; // code > 0x10ffff
+ (str[0] == 0xf4 && str[1] < 0x90) ? 4 : /* good four-byte */
+ -4; /* code > 0x10ffff */
}
-// Return true if str[0..len-1] is valid UTF-8 *and* it contains at least one
-// code of two or more bytes. This is used to determine whether or not to set
-// bit 11 in the zip header flags.
+/* Return true if str[0..len-1] is valid UTF-8 *and* it contains at least one
+ code of two or more bytes. This is used to determine whether or not to set
+ bit 11 in the zip header flags. */
local int isutf8(char const *str, size_t len) {
int utf8 = 0;
while (len) {