git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3578f17
)
fish: Fix 'copy-out' command when local directory is "/foo".
author
Richard Jones
<rjones@redhat.com>
Fri, 10 Sep 2010 09:27:45 +0000
(10:27 +0100)
committer
Richard Jones
<rjones@redhat.com>
Fri, 10 Sep 2010 09:27:45 +0000
(10:27 +0100)
fish/copy.c
patch
|
blob
|
history
diff --git
a/fish/copy.c
b/fish/copy.c
index
789e430
..
944f4cc
100644
(file)
--- a/
fish/copy.c
+++ b/
fish/copy.c
@@
-148,11
+148,14
@@
split_path (char *buf, size_t buf_size,
}
char *p = strrchr (buf, '/');
- if (p && p > buf) {
+ if (p && p > buf) {
/* "foo/bar" */
*p = '\0';
p++;
if (dirname) *dirname = buf;
if (basename) *basename = p;
+ } else if (p && p == buf) { /* "/foo" */
+ if (dirname) *dirname = bad_cast ("/");
+ if (basename) *basename = buf+1;
} else {
if (dirname) *dirname = NULL;
if (basename) *basename = buf;