2011/11/2 Lluís Batlle i Rossell <virik...@gmail.com>:
> On Wed, Nov 02, 2011 at 01:00:50PM +0100, Eduardo Morras wrote:
>> Sorry to contact you directly Lluis, i can receive mail form list
>> but can't post (my isp blacklisted this list)
>
> Weird. How could that happen?
>
>> At 12:19 02/11/2011, Lluís Batlle i Rossell wrote:
>> >I've just tried:
>> >
>> >fossil artifact c06ece1cc56e4713435c0bd1f1b70627248b4b6b > file.png
>> >
>> >And this outputs only 8 bytes of the png file. Maybe the artifact command
>> >assumes a text output?
>>
>> Do a cat file.png
>>
>> The filename 'file.png' has 8 bytes, perhaps you are getting only the 
>> filename.
>
> No no, the file has more bytes:
>
> $ wc -l file.png
> 12583 file.png
> $ sha1sum file.png
> 449e8639f9889bbff781ed916a49cb8394110f77  file.png
> $ fossil artifact 449e8639f9889bbff781ed916a49cb8394110f77 | wc -l
> 8
>
> What do you think?
> _______________________________________________
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>

The artifact command uses fossil_puts to display the contents. Fossil
puts uses strlen to determine the number of chars to be written. So
for binary files with embedded nulls this will fail.
Using fossil_puts in this case is arguably a mistake as it also does
encoding conversion.
You can work around it by providing a filename with the artifact command.

Mark
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to