[Pkg-mozext-commits] [adblock-plus] 82/98: Issue 5285 - Fix saving filters on clean Thunderbird or SeaMonkey profiles
David Prévot
taffit at moszumanska.debian.org
Tue Oct 24 01:30:25 UTC 2017
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository adblock-plus.
commit d29bfefa1e45802fc406f7d993d66ff799c6fcca
Author: Wladimir Palant <trev at adblockplus.org>
Date: Thu Jun 1 11:15:41 2017 +0200
Issue 5285 - Fix saving filters on clean Thunderbird or SeaMonkey profiles
---
lib/io.js | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/lib/io.js b/lib/io.js
index ad11c96..0a22513 100644
--- a/lib/io.js
+++ b/lib/io.js
@@ -76,6 +76,15 @@ function legacyFile(fileName)
return file;
}
+function ensureDirExists(file)
+{
+ if (!file.exists())
+ {
+ ensureDirExists(file.parent);
+ file.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755);
+ }
+}
+
let fallback = {
readFromFile(fileName, listener)
{
@@ -91,7 +100,9 @@ let fallback = {
writeToFile(fileName, data)
{
- return callLegacy("writeToFile", legacyFile(fileName), data);
+ let file = legacyFile(fileName);
+ ensureDirExists(file.parent);
+ return callLegacy("writeToFile", file, data);
},
copyFile(fromFile, toFile)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git
More information about the Pkg-mozext-commits
mailing list