From: Richard Jones Date: Fri, 10 Sep 2010 09:27:45 +0000 (+0100) Subject: fish: Fix 'copy-out' command when local directory is "/foo". X-Git-Tag: 1.5.11~3 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=878c8c77d8b46b1c4dd5189f67f0262d44eed70c;p=libguestfs.git fish: Fix 'copy-out' command when local directory is "/foo". --- diff --git a/fish/copy.c b/fish/copy.c index 789e430..944f4cc 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;