CC: | gwyn [...] cpan.org |
Subject: | Parsing of linux kernel unified diffs |
Date: | Sat, 16 Dec 2006 00:40:02 -0500 |
To: | bug-text-diff-parser [...] rt.cpan.org |
From: | Nelson Elhage <nelhage [...] MIT.EDU> |
In attempting to use Text::Diff::Parser to parse patches to the linux
kernel taken from kernel.org, I've run into some bugs in its diff
parsing. The attached diff appears to contain two features it is
unable to handle.
First: The filename lines (e.g --- a/kernel/sys.c) don't contain
either a date or a revision after the filename.
Second: The @@ line contains the C function the diff occurred in after
the lines
(@@ -1983,7 +1983,7 @@ asmlinkage long sys_prctl(int option, un)
T::D::P appears to be unable to handle either feature of the unified
diff; As-is, it reports it to be a zero-change diff; If dates or
revisions are added, it reports a parser error looking for the @@ line.
- Nelson Elhage
=============================
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1983,7 +1983,7 @@ asmlinkage long sys_prctl(int option, uno
error = current->mm->dumpable;
break;
case PR_SET_DUMPABLE:
- if (arg2 < 0 || arg2 > 2) {
+ if (arg2 < 0 || arg2 > 1) {
error = -EINVAL;
break;
}
=============================
(Diff taken from
http://www.kernel.org/git/?p=linux/kernel/git/stable/linux-2.6.19.y.git;a=commitdiff_plain;h=abf75a5033d4da7b8a7e92321d74021d1fcfb502;hp=b2d6744849b5bf6b4593b81c136772df7a238ac9
)