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)