patch(1) doesn't recognize ed-style diffs that start with an insert
command as such. Same holds true for substitution command, but with the
current state of support for s/, I don't think it makes sense to support
diffs starting with s/.//.

Thoughts?

natano


Index: pch.c
===================================================================
RCS file: /cvs/src/usr.bin/patch/pch.c,v
retrieving revision 1.54
diff -u -p -r1.54 pch.c
--- pch.c       16 Oct 2015 07:33:47 -0000      1.54
+++ pch.c       21 Feb 2016 19:39:14 -0000
@@ -287,7 +287,7 @@ intuit_diff_type(void)
                for (t = s; isdigit((unsigned char)*t) || *t == ','; t++)
                        ;
                this_is_a_command = (isdigit((unsigned char)*s) &&
-                   (*t == 'd' || *t == 'c' || *t == 'a'));
+                   (*t == 'a' || *t == 'c' || *t == 'd' || *t == 'i'));
                if (first_command_line < 0 && this_is_a_command) {
                        first_command_line = this_line;
                        fcl_line = p_input_line;

Reply via email to