OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc8139a
)
Add output path to cp error message filenames.
author
Rob Landley
<rob@landley.net>
Mon, 30 May 2016 18:43:17 +0000
(13:43 -0500)
committer
Rob Landley
<rob@landley.net>
Mon, 30 May 2016 18:43:17 +0000
(13:43 -0500)
toys/posix/cp.c
patch
|
blob
|
history
diff --git
a/toys/posix/cp.c
b/toys/posix/cp.c
index
ea1ef6f
..
d21af2f
100644
(file)
--- a/
toys/posix/cp.c
+++ b/
toys/posix/cp.c
@@
-345,7
+345,19
@@
int cp_node(struct dirtree *try)
err = "%s";
}
- if (err) perror_msg(err, catch);
+ if (err) {
+ char *f = 0;
+
+ if (catch == try->name) {
+ f = dirtree_path(try, 0);
+ while (try->parent) try = try->parent;
+ catch = xmprintf("%s%s", TT.destname, f+strlen(try->name));
+ free(f);
+ f = catch;
+ }
+ perror_msg(err, catch);
+ free(f);
+ }
return 0;
}