author | Brandon Casey <casey@nrlssc.navy.mil> | |
Wed, 1 Oct 2008 19:28:26 +0000 (14:28 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 16 Oct 2008 15:31:56 +0000 (08:31 -0700) | ||
commit | 563d5a2c84fb5daf77dd8bfe569e92566a8fd52b | |
tree | 36c847c21a3e882bd2db3ef33c83722bf11c8518 | tree | snapshot |
parent | b19d288b4d440c76348b519d06a4ed7b62c93611 | commit | diff |
xdiff-interface.c: strip newline (and cr) from line before pattern matching
POSIX doth sayeth:
"In the regular expression processing described in IEEE Std 1003.1-2001,
the <newline> is regarded as an ordinary character and both a period and
a non-matching list can match one. ... Those utilities (like grep) that
do not allow <newline>s to match are responsible for eliminating any
<newline> from strings before matching against the RE."
Thus far git has not been removing the trailing newline from strings matched
against regular expression patterns. This has the effect that (quoting
Jonathan del Strother) "... a line containing just 'FUNCNAME' (terminated by
a newline) will be matched by the pattern '^(FUNCNAME.$)' but not
'^(FUNCNAME$)'", and more simply not '^FUNCNAME$'.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
POSIX doth sayeth:
"In the regular expression processing described in IEEE Std 1003.1-2001,
the <newline> is regarded as an ordinary character and both a period and
a non-matching list can match one. ... Those utilities (like grep) that
do not allow <newline>s to match are responsible for eliminating any
<newline> from strings before matching against the RE."
Thus far git has not been removing the trailing newline from strings matched
against regular expression patterns. This has the effect that (quoting
Jonathan del Strother) "... a line containing just 'FUNCNAME' (terminated by
a newline) will be matched by the pattern '^(FUNCNAME.$)' but not
'^(FUNCNAME$)'", and more simply not '^FUNCNAME$'.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
t/t4018-diff-funcname.sh | diff | blob | history | |
xdiff-interface.c | diff | blob | history |