X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=editors%2Fpatch.c;h=f8d7605c0d4ab707766a9dedd223b7546e035c8d;hb=bbe514683a43e81cab1d5ccc0436b9aaf984294b;hp=f11f8a1a2bdbc8b7f6881d9b9e7d31e911128e1b;hpb=079f8afa0a16112cbaf7012c82b38b7358b82141;p=oweals%2Fbusybox.git diff --git a/editors/patch.c b/editors/patch.c index f11f8a1a2..f8d7605c0 100644 --- a/editors/patch.c +++ b/editors/patch.c @@ -15,9 +15,8 @@ * * Issues * - Non-interactive - * - Patches must apply cleanly or the hunk will fail. + * - Patches must apply cleanly or patch (not just one hunk) will fail. * - Reject file isnt saved - * - */ #include @@ -117,12 +116,14 @@ int patch_main(int argc, char **argv) free(patch_line); patch_line = xmalloc_fgets(patch_file); } + /* FIXME: patch_line NULL check?? */ /* Extract the filename used before the patch was generated */ original_filename = extract_filename(patch_line, patch_level); free(patch_line); patch_line = xmalloc_fgets(patch_file); + /* FIXME: NULL check?? */ if (strncmp(patch_line, "+++ ", 4) != 0) { ret = 2; bb_error_msg("invalid patch"); @@ -212,6 +213,9 @@ int patch_main(int argc, char **argv) bb_error_msg("hunk #%d FAILED at %d", hunk_count, hunk_offset_start); hunk_error++; free(patch_line); + /* Probably need to find next hunk, etc... */ + /* but for now we just bail out */ + patch_line = NULL; break; } free(src_line);