Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jan 1996 03:59:08 GMT
From:      Adam David <adam@ubiq.veda.is>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/961: 'more $file', incorrect CRLF compacting.
Message-ID:  <199601220359.DAA00888@ubiq.veda.is>
Resent-Message-ID: <199601220400.UAA04186@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         961
>Category:       bin
>Synopsis:       'more $file', incorrect CRLF compacting.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 21 20:00:02 PST 1996
>Last-Modified:
>Originator:     Adam David
>Organization:
Veda Internet
>Release:        FreeBSD 2.2-CURRENT i386
>Environment:

	

>Description:

	'more' from a file containing CRLF sequences results in incorrect
	positioning within the file and the production of spurious output.
	CR is stripped on input to an internal buffer and the implementation
	is inconsistent about whether file positions are within the internal
	buffer or in the underlying file.

>How-To-Repeat:

	Let FILE.DOS be any typical DOS textfile containing CRLF as a line
	terminator. 'more FILE.DOS' and if it is more than one screenfull
	go to the end by pressing G. Compare the end of the more output with
	the output from 'tail FILE.DOS'.

>Fix:
	
	Strip CR on output from (rather than input to) the internal buffer
	when input is taken from a regular file. Otherwise, the internal and
	external file positioning would have to be tracked separately. There
	seem to be various kludges possible to tidy up the output in the
	existing implementation, but it is very messy.
	
	As a workaround, 'more <FILE.DOS' gives unmangled output.
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601220359.DAA00888>