Aittvax.144
net.4bsd-bugs,net.v7-bugs
utzoo!decvax!ittvax!swatt
Wed Nov 25 18:33:19 1981
dd(1) bug
Wed Nov 25 18:29:27 EST 1981 (reported by swatt)
[ ]    Bug in dd(1) "swab" routine prevents swabbing the bytes in the
       last word if the wordsize of a file is odd.  Fix is:

       -----------------------------------------------------------------
       cp /usr/src/cmd/dd.c /tmp/upd.$$.tmp ; chmod +w /tmp/upd.$$.tmp
       ed - /tmp/upd.$$.tmp <<\!XXFUNNYXX & C="((ibc" ~1) 332C>>1);
       .
       1c
       static char *sccsid = "@(#)dd.c 4.2 (ITT) 11/25/81";
       .
       w
       q
       !xxFUNNYxx
       diff /usr/src/cmd/dd.c /tmp/upd.$$.tmp >/tmp/upd.$$.dif
       if cmp - /tmp/upd.$$.dif <<\!XXFUNNYXX STATIC ; < CHAR 1C1 --- *SCCSID="@(#)dd.c        4.1 (Berkeley) 10/1/80"> static char *sccsid = "@(#)dd.c        4.2 (ITT) 11/25/81";
       332c332
       >1) & ~1;
       ---
       >               c = ((ibc & ~1)>>1);
       !xxFUNNYxx
       then
               : 'compare equal, ok'
               rm -f dd.c
               cp /tmp/upd.$$.tmp dd.c ; chmod a-w dd.c
       else
               echo "Old source file not same version;" \
                       "use diff listings by hand"
       fi
       rm -f /tmp/upd.$$.tmp /tmp/upd.$$.dif
       -----------------------------------------------------------------
       [ /bin/dd:
               dd.c    4.1 (Berkeley) 10/1/80 ]

-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <[email protected]>
of http://communication.ucsd.edu/A-News/


This Usenet Oldnews Archive
article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.