pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mk

Module Name:    pkgsrc
Committed By:   rillig
Date:           Fri Jan 18 11:16:08 UTC 2008

Modified Files:

Log Message:
Don't rely on file(1) to distinguish text files from binary files. This
has proven too unreliable in the past. For example, some
files were classified as "Quake I or II world or extension", just
because they happen to start with the letters "PACK". This method was
also subject to subtle differences in the locale.

The new method counts the number of NUL bytes in the file. It does not
depend on the locale settings. The -c option of wc(1) counts bytes, not
characters, and tr(1), which may interpret multibyte sequences, is
protected by LC_ALL. It should also work with the historical
implementations of tr(1) that could not handle NUL bytes and discarded
them, since this is exactly the intention.

See also:
* PR 37793

To generate a diff of this commit:
cvs rdiff -r1.49 -r1.50 pkgsrc/mk/

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Home | Main Index | Thread Index | Old Index