From 7e346f16778a21926ca172008241d52f9f517222 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 27 Jun 2011 06:51:40 +0200 Subject: [PATCH] Include architecture in package links dir names --- .../file_systems/packagefs/PackageLinkDirectory.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.cpp b/src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.cpp index 86fab0f19b..8b88e14eea 100644 --- a/src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.cpp +++ b/src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.cpp @@ -56,17 +56,30 @@ PackageLinkDirectory::Init(Directory* parent, Package* package) // + 1 for the '-' } + const char* architecture = package->ArchitectureName(); + if (architecture != NULL) { + size += 1 + strlen(architecture); + // + 1 for the '-' + } + // allocate the name and compose it char* name = (char*)malloc(size); if (name == NULL) return B_NO_MEMORY; memcpy(name, package->Name(), nameLength + 1); + if (version != NULL) { name[nameLength] = '-'; version->ToString(name + nameLength + 1, size - nameLength - 1); } + if (architecture != NULL) { + nameLength += strlen(name + nameLength); + name[nameLength] = '-'; + strlcpy(name + nameLength + 1, architecture, size - nameLength - 1); + } + // init the directory/node status_t error = Init(parent, name, NODE_FLAG_KEEP_NAME); if (error != B_OK)