Ticket #4732: installer.patch

File installer.patch, 1.3 KB (added by idefix, 15 years ago)

(patch) get Installer to show unzipped files when installing to volume containing space

  • src/apps/installer/UnzipEngine.cpp

     
    298298status_t
    299299UnzipEngine::_ReadLineExtract(const BString& line)
    300300{
    301     char item[1024];
    302     char linkTarget[256];
    303     const char* kCreatingFormat = "    creating: %s\n";
    304     const char* kInflatingFormat = "   inflating: %s\n";
    305     const char* kLinkingFormat = "     linking: %s -> %s\n";
    306     if (sscanf(line.String(), kCreatingFormat, &item) == 1
    307         || sscanf(line.String(), kInflatingFormat, &item) == 1
    308         || sscanf(line.String(), kLinkingFormat, &item,
    309             &linkTarget) == 2) {
     301    const char* kCreatingFormat = "   creating:";
     302    const char* kInflatingFormat = "  inflating:";
     303    const char* kLinkingFormat = "    linking:";
     304    if (line.FindFirst(kCreatingFormat) == 0
     305        || line.FindFirst(kInflatingFormat) == 0
     306        || line.FindFirst(kLinkingFormat) == 0) {
    310307
    311308        fItemsUncompressed++;
    312309
    313         BString itemPath(item);
    314         int pos = itemPath.FindLast('/');
     310        BString itemPath;
     311
     312        int pos = line.FindLast("  -> ");
     313        if (pos > 0)
     314            line.CopyInto(itemPath, 13, pos - 13);
     315        else
     316            line.CopyInto(itemPath, 13, line.CountChars() - 14);
     317
     318        pos = itemPath.FindLast('/');
    315319        BString itemName = itemPath.String() + pos + 1;
    316320        itemPath.Truncate(pos);
    317321