From e554e315b762d564b4e370fa77a26ef6a4a67ccc Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Sat, 12 Aug 2017 17:49:30 +0200
Subject: Fixed a bug occurring when content filenames do not contain directory
 separators.

---
 ChangeLog                    |  5 +++++
 src/analysis/contents/file.c | 12 +++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 2a0707c..1718899 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 17-08-12  Cyrille Bagard <nocbos@gmail.com>
 
+	* src/analysis/contents/file.c:
+	Fix a bug occurring when content filenames do not contain directory separators.
+
+17-08-12  Cyrille Bagard <nocbos@gmail.com>
+
 	* src/analysis/db/server.c:
 	Do not block on server close.
 
diff --git a/src/analysis/contents/file.c b/src/analysis/contents/file.c
index 9f37646..b6cd39c 100644
--- a/src/analysis/contents/file.c
+++ b/src/analysis/contents/file.c
@@ -384,8 +384,18 @@ static const char *g_file_content_describe(const GFileContent *content, bool ful
 
     if (full)
         result = content->filename;
+
     else
-        result = strrchr(content->filename, G_DIR_SEPARATOR) + 1;
+    {
+        result = strrchr(content->filename, G_DIR_SEPARATOR);
+
+        if (result == NULL)
+            result = content->filename;
+
+        else
+            result++;
+
+    }
 
     return result;
 
-- 
cgit v0.11.2-87-g4458