| Index: courgette/courgette_tool.cc
|
| ===================================================================
|
| --- courgette/courgette_tool.cc (revision 80344)
|
| +++ courgette/courgette_tool.cc (working copy)
|
| @@ -303,20 +303,39 @@
|
| #endif
|
|
|
| courgette::Status status =
|
| - courgette::ApplyEnsemblePatch(old_path.value().c_str(),
|
| - patch_path.value().c_str(),
|
| - new_path.value().c_str());
|
| + courgette::ApplyEnsemblePatch(old_path.value().c_str(),
|
| + patch_path.value().c_str(),
|
| + new_path.value().c_str());
|
|
|
| if (status == courgette::C_OK)
|
| return;
|
|
|
| // Diagnose the error.
|
| - if (status == courgette::C_BAD_ENSEMBLE_MAGIC)
|
| - Problem("Not a courgette patch");
|
| - if (status == courgette::C_BAD_ENSEMBLE_VERSION)
|
| - Problem("Wrong version patch");
|
| - if (status == courgette::C_BAD_ENSEMBLE_HEADER)
|
| - Problem("Corrupt patch");
|
| + switch (status) {
|
| + case courgette::C_BAD_ENSEMBLE_MAGIC:
|
| + Problem("Not a courgette patch");
|
| + break;
|
| +
|
| + case courgette::C_BAD_ENSEMBLE_VERSION:
|
| + Problem("Wrong version patch");
|
| + break;
|
| +
|
| + case courgette::C_BAD_ENSEMBLE_HEADER:
|
| + Problem("Corrupt patch");
|
| + break;
|
| +
|
| + case courgette::C_DISASSEMBLY_FAILED:
|
| + Problem("Disassembly failed (could be because of memory issues)");
|
| + break;
|
| +
|
| + case courgette::C_STREAM_ERROR:
|
| + Problem("Stream error (likely out of memory or disk space)");
|
| + break;
|
| +
|
| + default:
|
| + break;
|
| + }
|
| +
|
| // If we failed due to a missing input file, this will
|
| // print the message.
|
| std::string old_buffer = ReadOrFail(old_file, "'old' input");
|
|
|