Skip to content

Commit

Permalink
partial fix for #15
Browse files Browse the repository at this point in the history
  • Loading branch information
asiekierka committed Jun 2, 2022
1 parent db2fb65 commit f067b9d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/src/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class BaseStorage {
else if (this.ignoreCase) newKey = newKey.toLowerCase();

if (this.use83Names) {
// TODO: Handle periods better.
// https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/18e63b13-ba43-4f5f-a5b7-11e871b71f14
var nkSplit = newKey.split(".", 2);
var findTildedName = false;
if (nkSplit[0].length > 8) {
Expand All @@ -58,9 +60,10 @@ class BaseStorage {
}
if (findTildedName) {
var i = 1;
var fnConverted = nkSplit[0].replaceAll(" ", "");
while (1) {
var is = i.toString();
nkSplit[0] = nkSplit[0].substring(0, 7 - is.length) + "~" + is;
nkSplit[0] = fnConverted.substring(0, 7 - is.length) + "~" + is;
newKey = nkSplit.join(".");
if (this.get(newKey) == null) {
break;
Expand Down

0 comments on commit f067b9d

Please sign in to comment.