AppInfoList: make sure to dereference symlink before comparing
May fix #15633 (untested) Change-Id: Id0c8f0617553d988e767bae46fe0ac8fd3e698e9 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2118 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
parent
3548a2eb71
commit
0e7d1f13e0
@ -291,8 +291,14 @@ int32
|
||||
AppInfoList::IndexOf(const entry_ref *ref) const
|
||||
{
|
||||
if (ref) {
|
||||
// Dereference symlink if needed
|
||||
BEntry entry(ref, true);
|
||||
entry_ref realRef;
|
||||
if (entry.GetRef(&realRef) != B_OK)
|
||||
realRef = *ref;
|
||||
|
||||
for (int32 i = 0; RosterAppInfo *info = InfoAt(i); i++) {
|
||||
if (info->ref == *ref)
|
||||
if (info->ref == realRef)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user