Try a shorter path length limit for long filenames in file sync

Might fix some errors on non-English Windows systems
This commit is contained in:
Dan Stillman 2012-02-28 02:08:55 -05:00
parent 2725e43b13
commit 06d29fc4da

View file

@ -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