Re: [PATCH 4/3] Avoid using 'lstat()' to figure out directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



+		if (ce->name[len]>  '/')
+			break;
+		if (ce->name[len]<  '/')
+			continue;

What about

	if (ce->name[len] < '/') {
		if (strchr(ce->name + len + 1, '/'))
			break;
		else
			continue;
	}

to just punt if we'd go into a directory? I'm not much worried about accessing foo-0001, foo-0002, foo-0003 while looking for foo/a (that would be O(number of files in a directory), which is bearable), but risking to go down a huge subtree is not very nice.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]