|
5 | 5 | local string_sub, string_find = string.sub, string.find
|
6 | 6 |
|
7 | 7 | --------------------------------------------------------------------------------
|
8 |
| -function basic_dump(o) |
| 8 | +local function basic_dump(o) |
9 | 9 | local tp = type(o)
|
10 | 10 | if tp == "number" then
|
11 | 11 | return tostring(o)
|
@@ -200,18 +200,6 @@ function table.indexof(list, val)
|
200 | 200 | return -1
|
201 | 201 | end
|
202 | 202 |
|
203 |
| --------------------------------------------------------------------------------- |
204 |
| -if INIT ~= "client" then |
205 |
| - function file_exists(filename) |
206 |
| - local f = io.open(filename, "r") |
207 |
| - if f == nil then |
208 |
| - return false |
209 |
| - else |
210 |
| - f:close() |
211 |
| - return true |
212 |
| - end |
213 |
| - end |
214 |
| -end |
215 | 203 | --------------------------------------------------------------------------------
|
216 | 204 | function string:trim()
|
217 | 205 | return (self:gsub("^%s*(.-)%s*$", "%1"))
|
@@ -254,64 +242,6 @@ function math.factorial(x)
|
254 | 242 | return v
|
255 | 243 | end
|
256 | 244 |
|
257 |
| --------------------------------------------------------------------------------- |
258 |
| -function get_last_folder(text,count) |
259 |
| - local parts = text:split(DIR_DELIM) |
260 |
| - |
261 |
| - if count == nil then |
262 |
| - return parts[#parts] |
263 |
| - end |
264 |
| - |
265 |
| - local retval = "" |
266 |
| - for i=1,count,1 do |
267 |
| - retval = retval .. parts[#parts - (count-i)] .. DIR_DELIM |
268 |
| - end |
269 |
| - |
270 |
| - return retval |
271 |
| -end |
272 |
| - |
273 |
| --------------------------------------------------------------------------------- |
274 |
| -function cleanup_path(temppath) |
275 |
| - |
276 |
| - local parts = temppath:split("-") |
277 |
| - temppath = "" |
278 |
| - for i=1,#parts,1 do |
279 |
| - if temppath ~= "" then |
280 |
| - temppath = temppath .. "_" |
281 |
| - end |
282 |
| - temppath = temppath .. parts[i] |
283 |
| - end |
284 |
| - |
285 |
| - parts = temppath:split(".") |
286 |
| - temppath = "" |
287 |
| - for i=1,#parts,1 do |
288 |
| - if temppath ~= "" then |
289 |
| - temppath = temppath .. "_" |
290 |
| - end |
291 |
| - temppath = temppath .. parts[i] |
292 |
| - end |
293 |
| - |
294 |
| - parts = temppath:split("'") |
295 |
| - temppath = "" |
296 |
| - for i=1,#parts,1 do |
297 |
| - if temppath ~= "" then |
298 |
| - temppath = temppath .. "" |
299 |
| - end |
300 |
| - temppath = temppath .. parts[i] |
301 |
| - end |
302 |
| - |
303 |
| - parts = temppath:split(" ") |
304 |
| - temppath = "" |
305 |
| - for i=1,#parts,1 do |
306 |
| - if temppath ~= "" then |
307 |
| - temppath = temppath |
308 |
| - end |
309 |
| - temppath = temppath .. parts[i] |
310 |
| - end |
311 |
| - |
312 |
| - return temppath |
313 |
| -end |
314 |
| - |
315 | 245 | function core.formspec_escape(text)
|
316 | 246 | if text ~= nil then
|
317 | 247 | text = string.gsub(text,"\\","\\\\")
|
|
0 commit comments