From fdddc839e83b79e75b202eb01478268fef63fe0a Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 23 Aug 2008 08:29:52 +0200 Subject: [PATCH] awful: drop lfs in favor of mkdir -p Signed-off-by: Julien Danjou --- lib/awful.lua.in | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/awful.lua.in b/lib/awful.lua.in index 182f68a15..caadcf1c8 100644 --- a/lib/awful.lua.in +++ b/lib/awful.lua.in @@ -28,7 +28,6 @@ local capi = hooks = hooks, keygrabber = keygrabber } -local lfs = require("lfs") --- awful: AWesome Functions very UsefuL module("awful") @@ -78,6 +77,13 @@ local function cycle(t, i) return i end +--- Create a directory +-- @param dir The directory. +-- @return mkdir return code +function mkdir(dir) + return os.execute("mkdir -p " .. dir) +end + --- Get the first client that got the urgent hint. -- @return The first urgent client. function client.urgent.get() @@ -870,11 +876,11 @@ local function prompt_history_save(id) if prompt.history[id] then local f = io.open(id, "w") if not f then - local dir = "" + local i = 0 for d in id:gfind(".-/") do - dir = dir .. d - lfs.mkdir(dir) + i = i + #d end + mkdir(id:sub(1, i - 1)) f = assert(io.open(id, "w")) end for i = 1, math.min(#prompt.history[id].table, prompt.history[id].max) do