]> git.e2factory.org Git - e2factory.git/commitdiff
e2lib.join: fix indentation
authorTobias Ulmer <tu@emlix.com>
Mon, 8 Sep 2014 15:50:01 +0000 (17:50 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:18 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua

index 7cf65c25fa72c9ed08dab551209c735f74555cde..b01956c7170aa39e5042e04f6865cf3503fd1d7a 100644 (file)
@@ -750,42 +750,42 @@ end
 -- @param ... Further path components, following the same rule as "p2".
 -- @return A joined path (string), which may be empty.
 function e2lib.join(p1, p2, ...)
-       assert(type(p1) == "string")
-       assert(p2 == nil or type(p2) == "string")
-
-       local sep = "/"
-       local args = {p1, p2, ...}
-       local buildpath = ""
-       local sepnext = false
-        local component
-
-       for i=1,#args do
-                component = args[i]
-               assert(type(component) == "string")
-
-               if sepnext then
-                       -- If the previous or next component already
-                       -- has a separator in the right place, we don't
-                       -- need to add one. We do however not go to the
-                       -- trouble removing multiple separators.
-                       if buildpath:sub(-1) == sep or
-                               component:sub(1) == sep then
-                               -- do nothing
-                       else
-                               buildpath = buildpath .. sep
-                       end
-               end
-
-               buildpath = buildpath .. component
-
-               if component:len() > 0 then
-                       sepnext = true
-               else
-                       sepnext = false
-               end
-       end
-
-       return buildpath
+    assert(type(p1) == "string")
+    assert(p2 == nil or type(p2) == "string")
+
+    local sep = "/"
+    local args = {p1, p2, ...}
+    local buildpath = ""
+    local sepnext = false
+    local component
+
+    for i=1,#args do
+        component = args[i]
+        assert(type(component) == "string")
+
+        if sepnext then
+            -- If the previous or next component already
+            -- has a separator in the right place, we don't
+            -- need to add one. We do however not go to the
+            -- trouble removing multiple separators.
+            if buildpath:sub(-1) == sep or
+                component:sub(1) == sep then
+                -- do nothing
+            else
+                buildpath = buildpath .. sep
+            end
+        end
+
+        buildpath = buildpath .. component
+
+        if component:len() > 0 then
+            sepnext = true
+        else
+            sepnext = false
+        end
+    end
+
+    return buildpath
 end
 
 --- Checks whether file matches some usual backup file names left behind by vi