]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Document another Solaris tr pitfall.
authorBruno Haible <bruno@clisp.org>
Fri, 4 Sep 2009 12:32:04 +0000 (06:32 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 4 Sep 2009 12:34:43 +0000 (06:34 -0600)
* doc/autoconf.texi (Limitations of Usual Tools) <tr>: 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 <ebb9@byu.net>
ChangeLog
doc/autoconf.texi

index c5be126a94bb97754102e4ac3f6c8b8834adb605..57a9d2590082553a3b8a040b610a060ebbc16941 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-08-30  Bruno Haible  <bruno@clisp.org>
+
+       Document another Solaris tr pitfall.
+       * doc/autoconf.texi (Limitations of Usual Tools) <tr>: 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  <ebb9@byu.net>
 
        Improve wording about what goes before AC_INIT.
index 1d1abfb4cc90f7095f1b2d1cb9bc8b6b704f4d88..27645cf22efe611533df679e37e48ce49b69cf7b 100644 (file)
@@ -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