fix: Don't create . or .. in the untar example
This commit is contained in:
parent
cd0c5df5f5
commit
6b1b8fef55
@ -88,6 +88,7 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
if (entry.metadata.type == MTAR_DIRECTORY)
|
if (entry.metadata.type == MTAR_DIRECTORY)
|
||||||
{
|
{
|
||||||
|
if (!strcmp(entry.metadata.name, ".") || !strcmp(entry.metadata.name, "..")) continue;
|
||||||
int status = untar_directory(&entry);
|
int status = untar_directory(&entry);
|
||||||
if (status != 0)
|
if (status != 0)
|
||||||
{
|
{
|
||||||
@ -223,4 +224,4 @@ int main(int argc, char** argv)
|
|||||||
} while (1);
|
} while (1);
|
||||||
minitar_close(&mp);
|
minitar_close(&mp);
|
||||||
return exit_status;
|
return exit_status;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user