Repository: lucy-clownfish
Updated Branches:
  refs/heads/master 2e66aac98 -> 1e2579403


Fix segfault with standalone .md in root dir


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/fbe310dc
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/fbe310dc
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/fbe310dc

Branch: refs/heads/master
Commit: fbe310dcb9779d7ef608e10dbf412722499eeaf7
Parents: 2e66aac
Author: Nick Wellnhofer <wellnho...@aevum.de>
Authored: Wed Aug 19 15:08:00 2015 +0200
Committer: Nick Wellnhofer <wellnho...@aevum.de>
Committed: Wed Aug 19 15:08:00 2015 +0200

----------------------------------------------------------------------
 compiler/src/CFCDocument.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fbe310dc/compiler/src/CFCDocument.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCDocument.c b/compiler/src/CFCDocument.c
index 8993b9c..6d1325c 100644
--- a/compiler/src/CFCDocument.c
+++ b/compiler/src/CFCDocument.c
@@ -64,7 +64,12 @@ CFCDocument_do_create(CFCDocument *self, const char *path,
     }
 
     const char *last_dir_sep = strrchr(self->path_part, CHY_DIR_SEP_CHAR);
-    self->name = CFCUtil_strdup(last_dir_sep + 1);
+    if (last_dir_sep) {
+        self->name = CFCUtil_strdup(last_dir_sep + 1);
+    }
+    else {
+        self->name = CFCUtil_strdup(self->path_part);
+    }
 
     S_register(self);
 

Reply via email to