From 878c8c77d8b46b1c4dd5189f67f0262d44eed70c Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Fri, 10 Sep 2010 10:27:45 +0100 Subject: [PATCH] fish: Fix 'copy-out' command when local directory is "/foo". --- fish/copy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 1.8.3.1