summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-02-24 12:14:38 +0100
committerAlexander Larsson <alexl@redhat.com>2016-02-24 20:43:23 +0100
commit6c285d2e4ac76e99df848e2dea3cb0633126728a (patch)
treebbce9a610c04e8a0b074538b79f19251f32e1ff4
parent1833142b14255f5ddf0fd2b991a4b5aa5a6ecc92 (diff)
downloadostree-6c285d2e4ac76e99df848e2dea3cb0633126728a.tar.gz
rofiles-fuse: Handle operations on the root
ENSURE_RELPATH breaks when path is "/". In that case we need to return "." instead of "". https://bugzilla.gnome.org/show_bug.cgi?id=762596
-rw-r--r--src/rofiles-fuse/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rofiles-fuse/main.c b/src/rofiles-fuse/main.c
index 4337f00f..3c910f1f 100644
--- a/src/rofiles-fuse/main.c
+++ b/src/rofiles-fuse/main.c
@@ -46,7 +46,10 @@ static GHashTable *created_devino_hash = NULL;
static inline const char *
ENSURE_RELPATH (const char *path)
{
- return path + strspn (path, "/");
+ path = path + strspn (path, "/");
+ if (*path == 0)
+ return ".";
+ return path;
}
typedef struct {