diff options
author | Richard Jones <rjones@redhat.com> | 2010-09-10 10:27:45 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2010-09-10 10:27:45 +0100 |
commit | 878c8c77d8b46b1c4dd5189f67f0262d44eed70c (patch) | |
tree | b71a3c3a3d9d7b4751e678f8b68fcee1e3142256 /fish/copy.c | |
parent | 3578f170a1f70a86fb2213fc576190ad5aff61be (diff) | |
download | libguestfs-878c8c77d8b46b1c4dd5189f67f0262d44eed70c.tar.gz libguestfs-878c8c77d8b46b1c4dd5189f67f0262d44eed70c.tar.xz libguestfs-878c8c77d8b46b1c4dd5189f67f0262d44eed70c.zip |
fish: Fix 'copy-out' command when local directory is "/foo".
Diffstat (limited to 'fish/copy.c')
-rw-r--r-- | fish/copy.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fish/copy.c b/fish/copy.c index 789e430d..944f4ccb 100644 --- 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; |