projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
716ccb2
)
Patch from Matt Kraai to fix debian bug #227081
author
Glenn L McGrath
<bug1@ihug.co.nz>
Sun, 11 Jan 2004 05:20:59 +0000
(
05:20
-0000)
committer
Glenn L McGrath
<bug1@ihug.co.nz>
Sun, 11 Jan 2004 05:20:59 +0000
(
05:20
-0000)
cp does not truncate existing destinations. That is, after
running
echo foo > foo
echo fubar > fubar
cp foo fubar
the contents of fubar are
foo
r
instead of
foo
libbb/copy_file.c
patch
|
blob
|
history
diff --git
a/libbb/copy_file.c
b/libbb/copy_file.c
index ffdb8242b3838331594b6516a7feafd1953d76ac..7ddb9a23fb745ad358bc8562c372246fd0b6bf95 100644
(file)
--- a/
libbb/copy_file.c
+++ b/
libbb/copy_file.c
@@
-153,7
+153,7
@@
int copy_file(const char *source, const char *dest, int flags)
}
}
- dst_fd = open(dest, O_WRONLY);
+ dst_fd = open(dest, O_WRONLY
|O_TRUNC
);
if (dst_fd == -1) {
if (!(flags & FILEUTILS_FORCE)) {
bb_perror_msg("unable to open `%s'", dest);