"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: got patch: handle "\ No newline at end of file"
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Sat, 19 Mar 2022 20:27:45 +0100

Download raw body.

Thread
On Sat, Mar 19, 2022 at 08:16:38PM +0100, Omar Polo wrote:
> I've never used subversion, but this seems an issue that patch(1) has
> and that we share too.  The format for the "---" and "+++" lines is
> roughly:
> 
> 	optional leading spaces as per isspace(3)
>                  vvvvv
> 	(---|+++)[ \t]*[^\t]+(\t.*)?\n
> 	               ^^^^^ ^^^^^^
> 		         |      |
> 		      filename  |
> 	              optional stuff after a tab
> 
> so tabs, as well as newlines and leading spaces are forbidden in path
> names by the format.  If theres some optional stuff after the name and
> the tab character gets converted into spaces the file path _will_ be
> mangled here as well.
> 
> I don't have any ideas on how to make this more reliable, if even
> possible.

In the absence of a tab, I believe all we can do is assume that the
path ends at the end of the line. svn patch does the same.