[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Re: propedit on svn:mime-type

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-03-10 17:40:49 CET

Rafael Garcia-Suarez wrote:

>Branko ÄŒibej <brane@xbc.nu> wrote:
>
>
>>Ah, one more I missed:
>>
>>Alex Waugh wrote:
>>
>>
>>
>>>+ else if (strcmp (name, SVN_PROP_IGNORE) == 0
>>>+ || strcmp (name, SVN_PROP_EXTERNALS) == 0)
>>>+ {
>>>+ new_value = svn_stringbuf_create_from_string (value, pool);
>>>+ /* Make sure that the last line ends in a newline */
>>>+ if (new_value->data[new_value->len - 1] != '\n')
>>>+ svn_stringbuf_appendbytes (new_value, "\n", sizeof ("\n"));
>>>+ }
>>>
>>>
>>>
>>You're adding one character, but sizeof("\n") is 2, not 1 (remember the
>>nul terminator, right?)
>>
>>
>
>I thought that sizeof("\n") == sizeof(char*).
>
>

No, the type of a string literal is a character array, not a character
pointer. So writing "\n" is semantically equivalent to writing

    (char[]){ '\n', '\0' }

if such a thing could be done in C.

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Mar 10 17:41:31 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.