From 06d29fc4da827c73f6e523bdb7e6a2937b6100cf Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 28 Feb 2012 02:08:55 -0500 Subject: [PATCH] Try a shorter path length limit for long filenames in file sync Might fix some errors on non-English Windows systems --- chrome/content/zotero/xpcom/storage.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index 9875e35a2..c2cde1267 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -1154,7 +1154,10 @@ Zotero.Sync.Storage = new function () { if (windowsLength) { var pathLength = destFile.path.length - destFile.leafName.length; - var newLength = 254 - pathLength; + // Limit should be 255, but a shorter limit seems to be + // enforced for nsIZipReader.extract() below on + // non-English systems + var newLength = 240 - pathLength; // Require 40 available characters in path -- this is arbitrary, // but otherwise filenames are going to end up being cut off if (newLength < 40) { @@ -1166,7 +1169,7 @@ Zotero.Sync.Storage = new function () { } } else { - var newLength = 254; + var newLength = 240; } // Shorten file if it's too long -- we don't relink it, but this should