summaryrefslogtreecommitdiff
path: root/beos
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-07 00:42:14 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-07 00:42:14 +0000
commit21f541fdefcb92cc832ed094ec0c19d4508b3980 (patch)
treedd956b5511327b61283875cc270686abc778f1e7 /beos
parent6fd280ad2e1c95107f491745136c9df74e864768 (diff)
downloadnetsurf-21f541fdefcb92cc832ed094ec0c19d4508b3980.tar.gz
netsurf-21f541fdefcb92cc832ed094ec0c19d4508b3980.tar.bz2
Dereference symlinks on B_REFS_RECEIVED. This way dropping a symlink to an html file actually opens the target, and succeeds in finding its related files. One can still enter the path to the symlink itself in the url bar as file:// anyway.
svn path=/trunk/netsurf/; revision=5503
Diffstat (limited to 'beos')
-rw-r--r--beos/beos_scaffolding.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/beos/beos_scaffolding.cpp b/beos/beos_scaffolding.cpp
index ae256bf0f..e0b3af943 100644
--- a/beos/beos_scaffolding.cpp
+++ b/beos/beos_scaffolding.cpp
@@ -405,6 +405,16 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
BNode node(path.Path());
if (node.InitCheck() < B_OK)
break;
+ if (node.IsSymLink()) {
+ // dereference the symlink
+ BEntry entry(path.Path(), true);
+ if (entry.InitCheck() < B_OK)
+ break;
+ if (entry.GetPath(&path) < B_OK)
+ break;
+ if (node.SetTo(path.Path()) < B_OK)
+ break;
+ }
attr_info ai;
if (node.GetAttrInfo("META:url", &ai) >= B_OK) {