From 129ac3155a855a69e4bfc2c25b045b230535fe1a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 4 Sep 2009 06:32:04 -0600 Subject: [PATCH] Document another Solaris tr pitfall. * doc/autoconf.texi (Limitations of Usual Tools) : Mention that Solaris /usr/bin/tr does not only have problems with replacing NUL bytes but discards all NUL bytes from the input. Signed-off-by: Eric Blake --- ChangeLog | 7 +++++++ doc/autoconf.texi | 13 +++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5be126a9..57a9d2590 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-30 Bruno Haible + + Document another Solaris tr pitfall. + * doc/autoconf.texi (Limitations of Usual Tools) : Mention + that Solaris /usr/bin/tr does not only have problems with + replacing NUL bytes but discards all NUL bytes from the input. + 2009-09-04 Eric Blake Improve wording about what goes before AC_INIT. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 1d1abfb4c..27645cf22 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -17817,16 +17817,21 @@ HAZY FANTAZY Posix requires @command{tr} to operate on binary files. But at least Solaris @command{/usr/ucb/tr} and @command{/usr/bin/tr} still fail to -handle @samp{\0} as the octal escape for @code{NUL}. On Solaris, when -using @command{tr} to neutralize a binary file by converting @code{NUL} -to a different character, it is necessary to use -@command{/usr/xpg4/bin/tr} instead. +handle @samp{\0} as the octal escape for @code{NUL}; these programs +always discard all @code{NUL} bytes from the input. On Solaris, when +using @command{tr} to process a binary file that may contain @code{NUL} +bytes, it is necessary to use @command{/usr/xpg4/bin/tr} instead, or +@command{/usr/xpg6/bin/tr} if that is available. @example $ @kbd{printf 'a\0b\n' | /usr/ucb/tr '\0' '~' | wc -c} 3 $ @kbd{printf 'a\0b\n' | /usr/xpg4/bin/tr '\0' '~' | wc -c} 4 +$ @kbd{printf 'a\0b\n' | /usr/ucb/tr x x | wc -c} +3 +$ @kbd{printf 'a\0b\n' | /usr/xpg4/bin/tr x x | wc -c} +4 @end example @end table -- 2.47.3