[gnote] Do not crash when $XDG_DATA_HOME is absent



commit 61dc661b3aad0a0811d752842c9f3a9247e8389d
Author: Debarshi Ray <debarshir src gnome org>
Date:   Thu Nov 4 23:26:49 2010 +0200

    Do not crash when $XDG_DATA_HOME is absent
    
    Use g_mkdir_with_parents instead of boost::filesystem and ensure that
    the directories are created S_IRWXU.
    
    Fixes: https://bugzilla.gnome.org/631408

 src/notemanager.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/notemanager.cpp b/src/notemanager.cpp
index fbacefd..7c9815b 100644
--- a/src/notemanager.cpp
+++ b/src/notemanager.cpp
@@ -1,6 +1,7 @@
 /*
  * gnote
  *
+ * Copyright (C) 2010 Debarshi Ray
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -199,8 +200,7 @@ namespace gnote {
   // For overriding in test methods.
   bool NoteManager::create_directory(const std::string & directory) const
   {
-    boost::filesystem::path p(directory);
-    return boost::filesystem::create_directory(p);
+    return g_mkdir_with_parents(directory.c_str(), S_IRWXU) == 0;
   }
 
   bool NoteManager::first_run() const



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]