Skip to content

Commit

Permalink
Use the same fileSystemRepresentation function for both parts of the …
Browse files Browse the repository at this point in the history
…path
  • Loading branch information
kornelski committed Jan 27, 2017
1 parent 0a869e8 commit ed16c5c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sparkle/SUBinaryDeltaCommon.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ static BOOL _hashOfFileContents(unsigned char* hash, FTSENT *ent)
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)
Expand All @@ -171,8 +174,8 @@ static BOOL _hashOfFileContents(unsigned char* hash, FTSENT *ent)
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;

Expand Down

0 comments on commit ed16c5c

Please sign in to comment.