From 6079f0e0f515d5711e2aa0c91ab8e6c62356fd67 Mon Sep 17 00:00:00 2001 From: mpmxyz Date: Sun, 18 Jan 2015 18:55:56 +0100 Subject: [PATCH] Fixed filesystem.list returning a list with duplicate values The error was caused by increasing the index i after removing its value: The value after the removed one was ignored. To see an effect you need two directories being neighbors in the list. Both also have to have a symbolic link or a mounting point inside. -> That's a rare but possible combination. Here an example: bugdir/ a/ link1 -> link somewhere b/ link2 -> link somewhere #ls bugdir a b b (!) --- .../assets/opencomputers/loot/OpenOS/lib/filesystem.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/opencomputers/loot/OpenOS/lib/filesystem.lua b/src/main/resources/assets/opencomputers/loot/OpenOS/lib/filesystem.lua index 0ab4e4e63..bb523ddc9 100644 --- a/src/main/resources/assets/opencomputers/loot/OpenOS/lib/filesystem.lua +++ b/src/main/resources/assets/opencomputers/loot/OpenOS/lib/filesystem.lua @@ -351,8 +351,8 @@ function filesystem.list(path) table.remove(result, i) else f = result[i] + i = i + 1 end - i = i + 1 end local i = 0 return function()