From a737f2c2aa7927d605523d4941cf7ce5577a91b0 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 21 Oct 2014 13:03:52 -0400 Subject: [PATCH] Treat 260-character paths as too long on Windows I understood the path limit to mean >260, but a user is seeing the error with a 260-character path [1], so let's try this. [1] https://forums.zotero.org/discussion/41410 --- chrome/content/zotero/xpcom/file.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/file.js b/chrome/content/zotero/xpcom/file.js index e6467c7ee..b971b5fb5 100644 --- a/chrome/content/zotero/xpcom/file.js +++ b/chrome/content/zotero/xpcom/file.js @@ -332,7 +332,10 @@ Zotero.File = new function(){ let fileNameByteLength = Zotero.Utilities.Internal.byteLength(file.leafName); // Windows API only allows paths of 260 characters - if (e.name == "NS_ERROR_FILE_NOT_FOUND" && pathByteLength > 260) { + // + // I think this should be >260 but we had a report of an error with exactly + // 260 chars: https://forums.zotero.org/discussion/41410 + if (e.name == "NS_ERROR_FILE_NOT_FOUND" && pathByteLength >= 260) { Zotero.debug("Path is " + file.path); pathError = true; }