All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Markus F.X.J. Oberhumer" <markus@oberhumer.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Fix ptrdiff_t vs. int
Date: Fri, 27 May 2005 19:42:55 +0200	[thread overview]
Message-ID: <42975C1F.8070102@oberhumer.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0505271024280.17402@ppc970.osdl.org>

Linus Torvalds wrote:
> 
> On Fri, 27 May 2005, Linus Torvalds wrote:
> 
>>I can compile a kernel with "-m64", but since I don't have any 64-bit
>>libraries installed, user space doesn't work that well ;)
> 
> 
> Btw, since this was the piece of code that I didn't bother simplifying 
> last time it was discussed (then it was just "ugly"), I took a different 
> approach instead, and committed the following..

Many thanks. BTW, this is probably completely irrelevant on all 
real-world machines and calling conventions, but still, lying on the 
number of arguments in vararg-functions is not my favourite practice.

~Markus

> 
> 		Linus
> 
> ---
> diff-tree 84c1afd7e7c69c6c3c0677d5ee01925d4c70d318 (from a9c9cef161b26ca610783dd0b180d18956c7b119)
> Author: Linus Torvalds <torvalds@ppc970.osdl.org>
> Date:   Fri May 27 10:22:09 2005 -0700
>     
>     git-diff-tree: simplify header output with '-z'
>     
>     No need to make them multiple lines, in fact we explicitly don't want that.
>     
>     This also fixes a 64-bit problem pointed out by Markus F.X.J. Oberhumer,
>     where we gave "%.*s" a "ptrdiff_t" length argument instead of an "int".
> 
> diff --git a/diff-tree.c b/diff-tree.c
> --- a/diff-tree.c
> +++ b/diff-tree.c
> @@ -269,18 +269,11 @@ static int call_diff_flush(void)
>  		return 0;
>  	}
>  	if (header) {
> -		if (diff_output_format == DIFF_FORMAT_MACHINE) {
> -			const char *ep, *cp;
> -			for (cp = header; *cp; cp = ep) {
> -				ep = strchr(cp, '\n');
> -				if (ep == 0) ep = cp + strlen(cp);
> -				printf("%.*s%c", ep-cp, cp, 0);
> -				if (*ep) ep++;
> -			}
> -		}
> -		else {
> -			printf("%s", header);
> -		}
> +		const char *fmt = "%s";
> +		if (diff_output_format == DIFF_FORMAT_MACHINE)
> +			fmt = "%s%c";
> +		
> +		printf(fmt, header, 0);
>  		header = NULL;
>  	}
>  	diff_flush(diff_output_format, 1);
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


-- 
Markus Oberhumer, <markus@oberhumer.com>, http://www.oberhumer.com/

  reply	other threads:[~2005-05-27 17:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-27 13:20 [PATCH] Fix ptrdiff_t vs. int Markus F.X.J. Oberhumer
2005-05-27 13:51 ` Danjel McGougan
2005-05-27 14:02 ` Morten Welinder
2005-05-27 16:25 ` H. Peter Anvin
2005-05-27 17:18 ` Linus Torvalds
2005-05-27 17:25   ` Linus Torvalds
2005-05-27 17:42     ` Markus F.X.J. Oberhumer [this message]
2005-05-27 17:58       ` H. Peter Anvin
2005-05-27 18:13       ` Linus Torvalds
2005-05-27 18:20     ` Junio C Hamano
2005-05-28  4:05       ` [PATCH] Adjust diff-helper to diff-tree -v -z changes Junio C Hamano
2005-05-29 18:31         ` Linus Torvalds
2005-05-29 20:21           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42975C1F.8070102@oberhumer.com \
    --to=markus@oberhumer.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.