diff --git a/chrome/content/zotero/xpcom/storage/storageLocal.js b/chrome/content/zotero/xpcom/storage/storageLocal.js index 992dc1d12..6ed7aba50 100644 --- a/chrome/content/zotero/xpcom/storage/storageLocal.js +++ b/chrome/content/zotero/xpcom/storage/storageLocal.js @@ -642,6 +642,7 @@ Zotero.Sync.Storage.Local = { return false; } + var dir = OS.Path.dirname(path); var fileName = OS.Path.basename(path); var renamed = false; @@ -651,7 +652,7 @@ Zotero.Sync.Storage.Local = { if (filteredName != fileName) { Zotero.debug("Filtering filename '" + fileName + "' to '" + filteredName + "'"); fileName = filteredName; - path = OS.Path.dirname(path, fileName); + path = OS.Path.join(dir, fileName); renamed = true; } @@ -670,7 +671,7 @@ Zotero.Sync.Storage.Local = { Zotero.debug("Changed filename '" + fileName + "' to '" + finalFileName + "'"); fileName = finalFileName; - path = OS.Path.dirname(path, fileName); + path = OS.Path.join(dir, fileName); // Abort if Windows path limitation would cause filenames to be overly truncated if (Zotero.isWin && fileName.length < 40) { @@ -859,7 +860,7 @@ Zotero.Sync.Storage.Local = { throw new Error(msg); } - destPath = OS.Path.join(OS.Path.dirname(destPath, shortened)); + destPath = OS.Path.join(OS.Path.dirname(destPath), shortened); if (primaryFile) { renamed = true;