git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: Brian Gernhardt <benji@silverinsanity.com>
Cc: Git List <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] grep: make show_line more portable
Date: Sun, 8 Mar 2009 22:22:07 -0400	[thread overview]
Message-ID: <76718490903081922p105ebf79vb0bf06989413887c@mail.gmail.com> (raw)
In-Reply-To: <1236561326-1231-1-git-send-email-benji@silverinsanity.com>

On Sun, Mar 8, 2009 at 9:15 PM, Brian Gernhardt
<benji@silverinsanity.com> wrote:
> On OS X the printf specifier "%.0s" outputs the entire string instead
> of 0 characters as POSIX states.

Does not reproduce for me:

$ cat foo.c && gcc -m64 foo.c -o foo32 && gcc foo.c -o foo64 && file
foo32 foo64 && ./foo32 && ./foo64
#include "stdio.h"
#include "stdlib.h"
main() {
	printf("1 '%.0s'\n", "foobar");
	printf("2 '%.*s'\n", 0, "foobar");
	exit(0);
}
foo32: Mach-O 64-bit executable x86_64
foo64: Mach-O executable i386
1 ''
2 ''
1 ''
2 ''

OS X 10.5.6 (Darwin 9.6.0). i686-apple-darwin9-gcc-4.0.1. Same linkage for both:

/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 111.1.3)

j.

  parent reply	other threads:[~2009-03-09  2:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-09  1:15 [PATCH] grep: make show_line more portable Brian Gernhardt
2009-03-09  1:35 ` Junio C Hamano
2009-03-09  2:22 ` Jay Soffian [this message]
2009-03-09  2:23   ` Jay Soffian
2009-03-09  2:44   ` Brian Gernhardt
2009-03-09  3:52     ` Junio C Hamano
2009-03-09  9:50       ` Johannes Schindelin
2009-03-09 19:34     ` René Scharfe

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=76718490903081922p105ebf79vb0bf06989413887c@mail.gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=benji@silverinsanity.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).