From ed16c5c2a08bc1db16c1f7261f90d3fc77013bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Fri, 27 Jan 2017 18:37:35 +0000 Subject: [PATCH] Use the same fileSystemRepresentation function for both parts of the path --- Sparkle/SUBinaryDeltaCommon.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Sparkle/SUBinaryDeltaCommon.m b/Sparkle/SUBinaryDeltaCommon.m index 42e9d6c0..9d10208e 100644 --- a/Sparkle/SUBinaryDeltaCommon.m +++ b/Sparkle/SUBinaryDeltaCommon.m @@ -163,6 +163,9 @@ NSString *hashOfTreeWithVersion(NSString *path, uint16_t majorVersion) CC_SHA1_CTX hashContext; CC_SHA1_Init(&hashContext); + // Ensure the path uses filesystem-specific Unicode normalization #1017 + NSString *normalizedPath = stringWithFileSystemRepresentation(pathBuffer); + FTSENT *ent = 0; while ((ent = fts_read(fts))) { if (ent->fts_info != FTS_F && ent->fts_info != FTS_SL && ent->fts_info != FTS_D) @@ -171,8 +174,8 @@ NSString *hashOfTreeWithVersion(NSString *path, uint16_t majorVersion) if (ent->fts_info == FTS_D && !MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBeigeMajorVersion)) { continue; } - - NSString *relativePath = pathRelativeToDirectory(path, stringWithFileSystemRepresentation(ent->fts_path)); + + NSString *relativePath = pathRelativeToDirectory(normalizedPath, stringWithFileSystemRepresentation(ent->fts_path)); if (relativePath.length == 0) continue;