Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!mcsun!hp4nl!ruuinf!piet From: piet@cs.ruu.nl (Piet van Oostrum) Newsgroups: comp.sys.atari.st Subject: CR/LF issues (was: PATCH utility needed) Message-ID: <4865@ruuinf.cs.ruu.nl> Date: 15 Feb 91 12:58:34 GMT References: <1991Feb3.132030.6405@tertius.in-berlin.de> <4823@ruuinf.cs.ruu.nl> Sender: news@ruuinf.cs.ruu.nl Reply-To: piet@cs.ruu.nl (Piet van Oostrum) Organization: Dept of Computer Science, Utrecht University, The Netherlands Lines: 58 In-reply-to: piet@cs.ruu.nl (Piet van Oostrum) PvO> I see some patch versions on atari.archive.umich.edu, but I don't know if PvO> they are the same versions or better, or worse. Maybe somebody from the PvO> archive management can comment? PvO> atari/gnustuff/tos: PvO> -rw-rw-r-- 1 226 121584 Aug 15 1989 patch.zoo PvO> atari/utilities: PvO> -rw-rw-r-- 1 226 91023 Apr 12 1989 patch.arc It seems that the latter one (patch.arc) is a very old one (compiled with gcc 1.23), and it looks like the one I had. The patch.zoo file is more recent, ported by bammi, with supposedly is better (I have not yet tried it). >>>>> In message <1991Feb13.042250.26102@chinet.chi.il.us>, saj@chinet.chi.il.us (Stephen Jacobs) (SJ) writes: SJ> I don't know if this is the problem, but the version of patch.ttp that SJ> I have is definitely sensitive to the difference between lines ending SJ> in ^J only (UNIX style) and those ending in ^J^M (most ST editors, and You probably mean ^M^J. SJ> the desktop). I haven't characterized the EXACT behavior, but I get SJ> the best results by putting both main file and patch into UNIX style SJ> before applying the Bammi told me to use the -l switch. By the way, I think that the TOS utilities that deal with text should generally accept both the LF only (Unix style) and the CR,LF (TOS style) of line delimiting. I know that the TOS style is THE legal way, but it generally doesn't harm to accept the Unix style. This brings me to another question: I am porting the GNU diff(3) programs and now I come to an intersting problem: What to do when comparing two files that differ only in the CR? I.e. one file is a TOS style, and the other is a Unix style text file, with the same contents. My initial solution was to disregard the CR completely. But somebody who tested the thing complained about that. But how do you output the differences if you want to consider them different? 1. If you take the "official" TOS stand the Unix style file is just a single line. But this seems impractical. 2. Print a warning but no diffs 3. consider the files to be completely different. But then there is no way to indicate what the difference is. You cannot put the CR in the diff because the CR is not part of the line, it belongs to the line separator. And there is no way to indicate the ABSENCE of the CR. GNU diff has a -a (ASCII) option. I think I will consider the files the same if -a is given, and different otherwise. But still the above mentioned problem remains. -- Piet* van Oostrum, Dept of Computer Science, Utrecht University, Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands. Telephone: +31 30 531806 Uucp: uunet!mcsun!ruuinf!piet Telefax: +31 30 513791 Internet: piet@cs.ruu.nl (*`Pete')