Re: [PATCH] Increase length of function name buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <junkio@xxxxxxx> writes:

> Andy Parkins <andyparkins@xxxxxxxxx> writes:
>
>> In xemit.c:xdl_emit_diff() a buffer for showing the function name as
>> commentary is allocated; this buffer was 40 characters.  This is a bit
>> small;...
 >...
> I wonder however which is easier to read, a loooong heading line
> as you do in this patch, or "...TailOfVeryLongClassName::method"
> that still fits on a single line without terminal line-wrapping.

Nah, I was stupid again.

It would give something silly like the attached patch if we do
what I suggested (notice the function header line which does not
give us anything useful).

Will apply your version as is.

---

diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index 07995ec..30d3df1 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -87,8 +87,10 @@ long i, char *buf, long sz, long *ll) {
 		    (isalpha((unsigned char)*rec) || /* identifier? */
 		     *rec == '_' ||	/* also identifier? */
 		     *rec == '$')) {	/* mysterious GNU diff's invention */
-			if (len > sz)
+			if (len > sz) {
+				rec += len - sz;
 				len = sz;
+			}
 			while (0 < len && isspace((unsigned char)rec[len - 1]))
 				len--;
 			memcpy(buf, rec, len);

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]