I ran across a bug in ls -b (fileutils-4.0). 

In particular, if you have a file named something like "x\024", where
\024 is the byte with the octal value 24, ls -b prints out "x\020".
This also occurs for "x\025" .. "x\027".

(I found this bug using the ftwalk test program, fv_stat, which creates
such a file, then compares ls(1) to ftwalk's built-in ls. I haven't
looked at your tests.)

The problem is in lib/quotearg.c, masking the octal digits & 3
instead of & 7. Context diff for fix follows:

*** quotearg.c~ Sat Mar 21 08:51:53 1998
--- quotearg.c  Thu Jan 27 00:51:51 2000
***************
*** 258,265 ****
                {
                  STORE ('\\');
                  STORE ('0' + (c >> 6));
!                 STORE ('0' + ((c >> 3) & 3));
!                 c = '0' + (c & 3);
                  goto store_c;
                }
              break;
--- 258,265 ----
                {
                  STORE ('\\');
                  STORE ('0' + (c >> 6));
!                 STORE ('0' + ((c >> 3) & 7));
!                 c = '0' + (c & 7);
                  goto store_c;
                }
              break;

-- 
/*
 *  Tom Hull * [EMAIL PROTECTED] * http://www.ocston.org/~thull/
 */

Reply via email to