Patch by idefix: Change the parsing of zip output so that Installer will show
the name of extracted items when the target volume name contains spaces. Closes ticket #4732, thanks! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36848 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -298,20 +298,25 @@ UnzipEngine::_ReadLineListing(const BString& line)
|
|||||||
status_t
|
status_t
|
||||||
UnzipEngine::_ReadLineExtract(const BString& line)
|
UnzipEngine::_ReadLineExtract(const BString& line)
|
||||||
{
|
{
|
||||||
char item[1024];
|
const char* kCreatingFormat = " creating:";
|
||||||
char linkTarget[256];
|
const char* kInflatingFormat = " inflating:";
|
||||||
const char* kCreatingFormat = " creating: %s\n";
|
const char* kLinkingFormat = " linking:";
|
||||||
const char* kInflatingFormat = " inflating: %s\n";
|
if (line.FindFirst(kCreatingFormat) == 0
|
||||||
const char* kLinkingFormat = " linking: %s -> %s\n";
|
|| line.FindFirst(kInflatingFormat) == 0
|
||||||
if (sscanf(line.String(), kCreatingFormat, &item) == 1
|
|| line.FindFirst(kLinkingFormat) == 0) {
|
||||||
|| sscanf(line.String(), kInflatingFormat, &item) == 1
|
|
||||||
|| sscanf(line.String(), kLinkingFormat, &item,
|
|
||||||
&linkTarget) == 2) {
|
|
||||||
|
|
||||||
fItemsUncompressed++;
|
fItemsUncompressed++;
|
||||||
|
|
||||||
BString itemPath(item);
|
BString itemPath;
|
||||||
int pos = itemPath.FindLast('/');
|
|
||||||
|
int pos = line.FindLast(" -> ");
|
||||||
|
if (pos > 0)
|
||||||
|
line.CopyInto(itemPath, 13, pos - 13);
|
||||||
|
else
|
||||||
|
line.CopyInto(itemPath, 13, line.CountChars() - 14);
|
||||||
|
|
||||||
|
itemPath.Trim();
|
||||||
|
pos = itemPath.FindLast('/');
|
||||||
BString itemName = itemPath.String() + pos + 1;
|
BString itemName = itemPath.String() + pos + 1;
|
||||||
itemPath.Truncate(pos);
|
itemPath.Truncate(pos);
|
||||||
|
|
||||||
@@ -326,7 +331,7 @@ UnzipEngine::_ReadLineExtract(const BString& line)
|
|||||||
|
|
||||||
_UpdateProgress(itemName.String(), itemPath.String());
|
_UpdateProgress(itemName.String(), itemPath.String());
|
||||||
} else {
|
} else {
|
||||||
// printf("ignored: %s", line.String());
|
// printf("ignored: '%s'\n", line.String());
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user