From owner-freebsd-standards Thu Apr 25 22: 3: 2 2002 Delivered-To: freebsd-standards@freebsd.org Received: from espresso.q9media.com (espresso.q9media.com [216.254.138.122]) by hub.freebsd.org (Postfix) with ESMTP id 7C81A37B419; Thu, 25 Apr 2002 22:02:56 -0700 (PDT) Received: (from mike@localhost) by espresso.q9media.com (8.11.6/8.11.6) id g3Q522975374; Fri, 26 Apr 2002 01:02:02 -0400 (EDT) (envelope-from mike) Date: Fri, 26 Apr 2002 01:02:02 -0400 From: Mike Barcroft To: "M. Warner Losh" Cc: drosih@rpi.edu, arch@FreeBSD.ORG, freebsd-standards@FreeBSD.ORG Subject: Re: diff & patch problem with 'No newline' Message-ID: <20020426010202.E43192@espresso.q9media.com> References: <20020425210035.A43192@espresso.q9media.com> <20020425.202217.82927028.imp@village.org> <20020426000849.C43192@espresso.q9media.com> <20020425.221245.99497735.imp@village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020425.221245.99497735.imp@village.org>; from imp@village.org on Thu, Apr 25, 2002 at 10:12:45PM -0600 Organization: The FreeBSD Project Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG M. Warner Losh writes: > In message: <20020426000849.C43192@espresso.q9media.com> > Mike Barcroft writes: > : Perhaps the people working on Subversion still have time to fix that > : designo before too many people start using it. Solaris 2.5.1, for > : instance, returns "Warning: missing newline at end of file" on stderr > : for this condition. > > Subversion already powers through this by forcing the user to install > gnu diff. That'll teach them. > What does POSIX.1 say about this matter? Nothing about this specific case, but: : STDOUT : ... : Diff Binary Output Format : In the POSIX locale, if one or both of the files being compared are : not text files, an unspecified format shall be used that contains the : pathnames of two files being compared and the string "differ". : : If both files being compared are text files, depending on the options : specified, one of the following formats shall be used to write the : differences. : ... ...where text file is defined as: : 3.392 Text File : : A file that contains characters organized into one or more lines. The : lines do not contain NUL characters and none can exceed {LINE_MAX} : bytes in length, including the . Although : IEEE Std 1003.1-2001 does not distinguish between text files and : files (see the ISO C standard), many utilities only produce : predictable or meaningful output when operating on text files. The : standard utilities that have such restrictions always specify text : files in their STDIN or INPUT FILES sections. Since the Standard doesn't allow additional output on STDOUT (with good reason, since it breaks patch), we have two ways to conform, either take the Solaris way and utilize: : STDERR : The standard error shall be used only for diagnostic messages. ...or utilize the binary output option, which I recommend since I don't consider files without trailing newlines to be text files. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message