summaryrefslogtreecommitdiff
path: root/luaif
diff options
context:
space:
mode:
authorLauri Aarnio <Lauri.Aarnio@iki.fi>2008-03-12 08:59:11 +0200
committerLauri Leukkunen <lle@rahina.org>2008-03-14 07:43:43 +0200
commit1ffa4247130bac90816a9391b4aa1fff6ddb76d4 (patch)
treee4a860f921c0ec18325f1d526919b5d984fbe7bf /luaif
parent80fa17a48449506499d1795161b9b4b9318a1033 (diff)
sb_decolonize_path() bugfix: slashdot makes sense now
- sb_decolonize_path produced an empty string if the original path was /. (and then the mapping logic could not find any matching rules, which produced errors to the log)
Diffstat (limited to 'luaif')
-rw-r--r--luaif/paths.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/luaif/paths.c b/luaif/paths.c
index d129ac5..a8a9b96 100644
--- a/luaif/paths.c
+++ b/luaif/paths.c
@@ -142,7 +142,10 @@ proceed:
}
work = list.next;
- while (work) {
+ if (!work) {
+ /* "work" will be empty if orig.path was "/." */
+ strcat(buf, "/");
+ } else while (work) {
struct path_entry *tmp;
strcat(buf, "/");
strcat(buf, work->name);