On 12/30/11 07:43, Jim Meyering wrote: > Without useful stat.st_ino, there are some important tasks (e.g., dir > traversal) that simply cannot be performed safely/reliably.
In general that's true, and on further thought I agree we should leave that part of grep's st_ino code alone. I proposed that change only because POSIX says a zero st_ino value is valid, and I wanted grep to detect loops properly on a POSIX host that does that. But practice nobody ever does this for directories, and until they do it's more important to deal with actual Microsoft squirreliness than with hypothetical POSIX strictness. Maybe POSIX should get changed to require nonzero st_ino values? That would mean the current 'grep' code would be portable in theory.... While looking into this I noticed another porting issue: grep silently mishandles recursive directory loops on OpenVMS. The fix should be very simple. I'll start a new thread for that.