diff options
author | Mika Westerberg <mika.westerberg@iki.fi> | 2009-03-06 10:44:26 +0200 |
---|---|---|
committer | Lauri Leukkunen <lle@rahina.org> | 2009-03-07 16:05:39 +0200 |
commit | 5cd05d79bbc9f5f7c6b528b67708f6e9af6578db (patch) | |
tree | f602aef3d0ea08c8a62998d3764dc526f8037388 | |
parent | e9ea5d4c6c8c3714dea1ba96e78ccf3f1cd39ba5 (diff) |
Bugfix: When reversed_cwd cannot be resolved, real_cwd is used instead.
- This functionality is similar than it was before (when -r switch) was
used.
Signed-off-by: Lauri Aarnio <Lauri.Aarnio@iki.fi>
-rw-r--r-- | luaif/paths.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/luaif/paths.c b/luaif/paths.c index a91185e..28f1e0f 100644 --- a/luaif/paths.c +++ b/luaif/paths.c @@ -985,6 +985,17 @@ static void sbox_map_path_internal( luaif, (sbox_binary_name?sbox_binary_name:"UNKNOWN"), func_name, real_cwd); + if (reversed_cwd == NULL) { + /* + * In case reverse path couldn't be resolved + * we fallback into real_cwd. This is the + * way it used to work before. + */ + reversed_cwd = strdup(real_cwd); + SB_LOG(SB_LOGLEVEL_DEBUG, + "unable to reverse, using reversed_cwd=%s", + reversed_cwd); + } /* put the reversed CWD to our one-slot cache: */ if (luaif->real_cwd) free(luaif->real_cwd); if (luaif->reversed_cwd) free(luaif->reversed_cwd); |