Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Johnson <[email protected]>
  • Loading branch information
colincornaby and Hoikas authored Jul 10, 2024
1 parent 6045bf8 commit dcd06d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/Plasma/Apps/plClient/Mac-Cocoa/PLSPatcher.mm
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static la_ssize_t copy_data(struct archive* ar, struct archive* aw)
return (r);
r = archive_write_data_block(aw, buff, size, offset);
if (r < ARCHIVE_OK) {
plStatusLog::AddLineSF("%s\n", archive_error_string(aw));
pfPatcher::GetLog()->AddLine(plStatusLog::kRed, archive_error_string(aw));
return (r);
}
}
Expand Down Expand Up @@ -299,7 +299,7 @@ static la_ssize_t copy_data(struct archive* ar, struct archive* aw)
break;
}
const char* currentFile = archive_entry_pathname(entry);
auto fullOutputPath = plFileName::Join(plFileName(outputPath), plFileName(currentFile));
auto fullOutputPath = plFileName::Join(outputPath, currentFile);
archive_entry_set_pathname(entry, fullOutputPath.AsString().c_str());
r = archive_write_header(ext, entry);
if (r < ARCHIVE_OK)
Expand Down
4 changes: 2 additions & 2 deletions Sources/Plasma/Apps/plClient/Mac-Cocoa/main.mm
Original file line number Diff line number Diff line change
Expand Up @@ -427,14 +427,14 @@ - (void)patcherCompleted:(PLSPatcher*)patcher didSelfPatch:(BOOL)selfPatched
[NSApp endModalSession:self.currentModalSession];
[self.patcherWindow.window close];
if (selfPatched) {
NSError *error;
NSError* error;
NSURL* finalURL = [patcher completeSelfPatch:&error];

if (error) {
// uh oh, we couldn't self patch, present the error and bail
// this should be very rare and could be related to permissions issues
// we expect the game directory to be writable by all
NSAlert *errorAlert = [NSAlert alertWithError:error];
NSAlert* errorAlert = [NSAlert alertWithError:error];
[errorAlert runModal];
[NSApp terminate:self];
// return just in case we ever reach here
Expand Down

0 comments on commit dcd06d9

Please sign in to comment.