Subject: Re: [PATCH v2] log-tree: use custom line terminator in line termination mode

From: [email-masked] (Randal L. Schwartz)
Date: Mon, 30 Apr 2012 19:51:51 -0700

>>>>> "Junio" == Junio C Hamano <[email-masked]> writes:

Junio> Having said that, are we sure that

Junio> 	printf "add bar\0initial"

Junio> works per specification, or merely works by accident in some
Junio> implementation?

>>From the POSIX spec
(http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html):

    In addition to the escape sequences shown in XBD File Format Notation (
    '\\' , '\a' , '\b' , '\f' , '\n' , '\r' , '\t' , '\v' ), "\ddd" , where
    ddd is a one, two, or three-digit octal number, shall be written as a
    byte with the numeric value specified by the octal number.

Looks pretty intentional to me.  \0 is a nul.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email-masked]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion