Unix Technical Forum

Re: patch(1) w/paths containing spaces

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 ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 08:22 AM
Fabio Olive Leite
 
Posts: n/a
Default Re: patch(1) w/paths containing spaces

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:30 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com