[tracker-miners: 1/2] cli: XDG Directories
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners: 1/2] cli: XDG Directories
- Date: Fri, 11 Jun 2021 09:52:15 +0000 (UTC)
commit 8f62dfcdd39f8c2d208a2fd902cc09057638cbb7
Author: nitinosiris <nitinwartkar58 gmail com>
Date: Fri Jun 4 17:45:18 2021 +0530
cli: XDG Directories
If any environment doesn't have xdg directories set up
then it resulted in a SEG-fault. Adding a proper check solved it.
Fixes: #172
src/tracker/tracker-index.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/tracker/tracker-index.c b/src/tracker/tracker-index.c
index 89ed32671..7902f48dd 100644
--- a/src/tracker/tracker-index.c
+++ b/src/tracker/tracker-index.c
@@ -324,11 +324,16 @@ print_list (GStrv list,
else
continue;
- str = tracker_term_ellipsize (path, len, TRACKER_ELLIPSIZE_START);
- g_print ("%-*s " BOLD_BEGIN "%s" BOLD_END "\n",
- len, str,
- recursive ? "*" : "-");
- g_free (str);
+ if (path) {
+ str = tracker_term_ellipsize (path, len, TRACKER_ELLIPSIZE_START);
+ g_print ("%-*s " BOLD_BEGIN "%s" BOLD_END "\n",
+ len, str,
+ recursive ? "*" : "-");
+ g_free (str);
+ }
+ else {
+ g_print("Could not expand XDG user directory %s", list[i]);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]