--- - branch: MAIN date: Fri Jan 18 11:16:08 UTC 2008 files: - new: '1.50' old: '1.49' path: pkgsrc/mk/subst.mk pathrev: pkgsrc/mk/subst.mk@1.50 type: modified id: 20080118T111608Z.c72a607c38148bcea87535e0dc8ffc8ee9331812 log: | Don't rely on file(1) to distinguish text files from binary files. This has proven too unreliable in the past. For example, some Makefile.in 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: * http://mail-index.netbsd.org/tech-pkg/2006/07/05/0000.html * PR 37793 module: pkgsrc subject: 'CVS commit: pkgsrc/mk' unixtime: '1200654968' user: rillig