You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (![cumulativePath getFileSystemRepresentation:cumulativePathBuffer maxLength:PATH_MAX]) {
201
+
if (error != NULL) {
202
+
*error = [NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSStringstringWithFormat:@"Failed to create patch because '%@' cannot be converted to file system path.", cumulativePath] }];
203
+
}
204
+
*stop = YES;
205
+
return;
206
+
}
207
+
208
+
struct stat cumulativePathStat = {0};
209
+
if (lstat(cumulativePathBuffer, &cumulativePathStat) != 0) {
210
+
if (errno == ENOENT) {
211
+
// Directory doesn't exist, so it can't be a symlink - safe to continue
212
+
break;
213
+
}
214
+
215
+
if (error != NULL) {
216
+
*error = [NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSStringstringWithFormat:@"Failed to create patch because failed to stat '%@' with error: %d", cumulativePath, errno] }];
217
+
}
218
+
*stop = YES;
219
+
return;
220
+
}
221
+
222
+
if (S_ISLNK(cumulativePathStat.st_mode)) {
200
223
if (error != NULL) {
201
-
*error = [NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSStringstringWithFormat:@"Failed to create patch because '%@' cannot be a symbolic link.", destinationParentDirectory] }];
224
+
*error = [NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteUnknownError userInfo:@{ NSLocalizedDescriptionKey: [NSStringstringWithFormat:@"Failed to create patch because '%@' cannot contain a symbolic link in its intermediate path.", destinationFilePath.stringByDeletingLastPathComponent] }];
0 commit comments