🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Richard Doty Thu, 17 Dec 1987 00:04
long lines confuse sdiff
#656
Author: Richard Doty
Date: Thu, 17 Dec 1987 00:04
30 lines
1815 bytes
Index:	cmd/sdiff.c Sys5

Description:
	Sdiff gets confused if input lines are longer than its
	input buffer.  (this is version 1.2 of sdiff)
Repeat-By:
	Consider these two files, sd1 & sd2, each 3 lines long
	and each containing a line from nroff output with many backspaces.
	sd1:
111111......222222  SSSSSSeeeeeeccccccoooooonnnnnndddddd ssssssuuuuuubbbbbb hhhhhheeeeeeaaaaaaddddddiiiiiinnnnnngggggg
     Still more stuff.

	sd2:
type it.
x1111....2222  SSSSeeeeccccoooonnnndddd ssssuuuubbbb hhhheeeeaaaaddddiiiinnnngggg
     Still more stuff.

	The command "sdiff sd1 sd2" it loops producing and endless
	stream of blank lines.
Fix:
	Sdiff makes decisions based on what is at the beginning of each
	line, but in this case the input line was longer than sdiff's
	input buffer.  When the next "line" was input, sdiff actually
	read the last part of the present line, and made a bad choice (the
	specific problem with looping could have been fixed differently,
	but that would still leave the general problem of finding
	command text in the middle of a line rather than at the beginning).
	My fix is to look at each line as it is input.  If the last
	character is not a newline, discard subsequent input characters
	until a newline is encountered.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads