Re: [PATCH v12 03/10] strbuf: add a case insensitive starts_with()

2018-03-16 Thread Morten Welinder
You need to cast those arguments of tolower to (unsigned char). That's arguably a bug of the language. Character values less than zero aren't valid for tolower, unless they happen to equal EOF in which case the tolower calls don't mean what you want them to mean. Per the man page: "If c is

Re: [PATCH v2] die(): stop hiding errors due to overzealous recursion guard

2017-06-21 Thread Morten Welinder
If threading is the issue, how do you get meaningful results from reading and updating "dying" with no use of atomic types or locks? Other than winning the implied race, of course. M. On Wed, Jun 21, 2017 at 4:47 PM, Ævar Arnfjörð Bjarmason wrote: > Change the recursion

Re: Git v2.13.1 SHA1 very broken

2017-06-06 Thread Morten Welinder
One could have configure ask some existing dependency that has already determined the byte order. For example: # perl -e 'use Config; $o=$Config{byteorder}; print(($o=~/^1234/ ? "little" : ($o=~/4321$/ ? "big" : "weird")), "\n");' little Good: less #ifdef soup; bad: not so great for

Re: SHA1 collisions found

2017-02-27 Thread Morten Welinder
Just swap in md5 in place of sha1. Pad with '0'. That'll give you all the collisions you want and none of those you don't want. On Mon, Feb 27, 2017 at 5:43 AM, Jeff King wrote: > On Mon, Feb 27, 2017 at 10:57:37AM +0100, Geert Uytterhoeven wrote: > >> > Yeah, that is a lot more

Re: SHA1 collisions found

2017-02-23 Thread Morten Welinder
The attack seems to generate two 64-bytes blocks, one quarter of which is repeated data. (Table-1 in the paper.) Assuming the result of that is evenly distributed and that bytes are independent, we can estimate the chances that the result is NUL-free as (255/256)^192 = 47% and the probability

Re: weaning distributions off tarballs: extended verification of git tags

2015-02-28 Thread Morten Welinder
Is there a point to including a different checksum inside a git tag? If someone can break the SHA-1 checksum in the repository then the recorded SHA-256 checksum can be changed. In other words, wouldn't you be just as well off handing someone a SHA-1 commit id? If you can guard the SHA-256 with

Re: Fwd: possible Improving diff algoritm

2012-12-12 Thread Morten Welinder
So I think with s/Regularly/About half the time/, your observation above is correct. I think the reason you perceived this as Regularly is that you do not notice nor appreciate it when things go right (half the time), but you tend to notice and remember only when a wrong side happened to

Re: Fwd: possible Improving diff algoritm

2012-12-12 Thread Morten Welinder
Is there a reason why picking among the choices in a sliding window must be contents neutral? Sorry, you might be getting at something interesting but I do not understand the question. I have no idea what you mean by contents neutral. I was merely asking if an algorithm to pick between the

Re: [PATCH] mmap error handling

2005-07-28 Thread Morten Welinder
I have verified that successful close() after failed mmap() won't reset the output of perror() to Success. Does $standard guarantee that? In general, successful libc calls can set errno to whatever they please, except zero. And they sometimes do. This follows from C99. Morten - To

Re: WARNING! Object DB conversion (was Re: [PATCH] write-tree performance problems)

2005-04-20 Thread Morten Welinder
On 4/20/05, Martin Uecker [EMAIL PROTECTED] wrote: The storage method of the database of a collection of files in the underlying file system. Because of the random nature of the hashes this leads to a horrible amount of seeking for all operations which walk the logical structure of some tree

Re: Storing permissions

2005-04-16 Thread Morten Welinder
Does it really make sense to store full permissions in the trees? I think that remembering the x-bit should be good enough for almost all purposes and the other permissions should be left to the local environment. It makes some sense in principle, but without storing what they mean (i.e.,