This is a discussion on Re: patch(1) w/paths containing spaces within the mailing.openbsd.tech forums, part of the OpenBSD category; --> On Tue, Oct 26, 2004 at 01:18:44AM -0500, Jared Yanovich wrote: > > No one has tried or even ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On Tue, Oct 26, 2004 at 01:18:44AM -0500, Jared Yanovich wrote: > > No one has tried or even thought about this? Even ideas as to how the > parsing may be approached are welcomed, or other constraints, etc. I have thought a bit about it, but I currently don't have any spare time to code anything, so I have chosen to keep quiet and "shut up while I can't hack". But now that comments were asked again: I'm thinking about splitting the rest of the line after the ---, +++ or *** (?) markers into substrings on the white-space characters, having the pieces after the first with their own white-space prepended (this is confusing, will try again), so that we can loop trying to find a filename with the first piece, and if it can't be found then we append the second piece and try again, and so on. Example: +++ sys/kern/Oh my god who commited spaces??? SomeTime SomeRev We get the pieces as "sys/kern/Oh", " my", " god", " who", " commited", " spaces???", " SomeTime" and " SomeRev". In case it's not a CVS diff we don't get the " SomeRev" piece. Now we loop trying to find a file named "sys/kern/Oh", and if it can't be found, we try "sys/kern/Oh my", and then "sys/kern/Oh my god" and so on. If the damn file exists, it's bound to be found by this construct. Of course there will be flaws in the oddest cases, but this heuristic is about as close to what a human would try as possible. Comments? Sorry, as I said, no patch for now... -- I drowned in the universal pool of entropy Eris has saved me, and she has set me free |