Skip to content

Commit

Permalink
core.shm: Fix bug in resolve()
Browse files Browse the repository at this point in the history
Corrected bug caught by SnabbBot and selftest(). resolve() was broken.
  • Loading branch information
lukego committed Jun 5, 2015
1 parent 2b376f1 commit ffb4cf1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/core/shm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,9 @@ function map (name, type, readonly)
end

function resolve (name)
local result = name
-- q is qualifier ("", "/", "//")
local q, p = name:match("^(/*)(.*)")
-- Add path, if name is related and path is defined
local q, p = name:match("^(/*)(.*)") -- split qualifier (/ or //)
local result = p
if q == '' and path ~= '' then result = path.."/"..result end
-- Add process qualifier, unless name is fully qualified
if q ~= '//' then result = tostring(S.getpid()).."/"..result end
return result
end
Expand Down

0 comments on commit ffb4cf1

Please sign in to comment.