Thread View: net.4bsd-bugs
1 messages
1 total messages
Started by ittvaxswatt
Wed, 25 Nov 1981 19:37
cp(1) bug
Author: ittvaxswatt
Date: Wed, 25 Nov 1981 19:37
Date: Wed, 25 Nov 1981 19:37
56 lines
1944 bytes
1944 bytes
Wed Nov 25 19:15:37 EST 1981 (reported by swatt)
[ ] "cp" when faced with a source argument which is a
directory copies the data of the directory file into
a plain file in the destination area. This is
obnoxious; either it should allow recursive copying
of directory trees or it should ignore directory
source arguments. Fix is:
________________________________________________________
cp /usr/src/cmd/cp.c /tmp/upd.$$.tmp ; chmod +w /tmp/upd.$$.tmp
ed - /tmp/upd.$$.tmp <<\!xxFUNNYxx
71a
/* Is source a directory? if so, skip it.
* Probably more reasonable action would be to
* copy contents of directory if -r flag set
*/
if ((mode&S_IFMT) == S_IFDIR) {
close (fold);
fprintf (stderr, "%s is a directory (ignored)\n", from);
return;
}
.
1c
static char *sccsid = "@(#)cp.c 4.2 (ITT) 11/19/81";
.
w
q
!xxFUNNYxx
diff /usr/src/cmd/cp.c /tmp/upd.$$.tmp >/tmp/upd.$$.dif
if cmp - /tmp/upd.$$.dif <<\!xxFUNNYxx
1c1
< static char *sccsid = "@(#)cp.c 4.1 (Berkeley) 10/1/80";
---
> static char *sccsid = "@(#)cp.c 4.2 (ITT) 11/19/81";
71a72,80
> /* Is source a directory? if so, skip it.
> * Probably more reasonable action would be to
> * copy contents of directory if -r flag set
> */
> if ((mode&S_IFMT) == S_IFDIR) {
> close (fold);
> fprintf (stderr, "%s is a directory (ignored)\n", from);
> return;
> }
!xxFUNNYxx
then
: 'compare equal, ok'
rm -f cp.c
cp /tmp/upd.$$.tmp cp.c ; chmod a-w cp.c
else
echo "Old source file not same version;" \
"use diff listings by hand"
fi
rm -f /tmp/upd.$$.tmp /tmp/upd.$$.dif
________________________________________________________
[ /bin/cp:
cp.c 4.1 (Berkeley) 10/1/80 ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads