Skip to content

Commit

Permalink
[PAKPack] Trim backwards relative paths & fix argument count
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Weermann (TGE) committed May 28, 2018
1 parent 3abb1f2 commit 797b74a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/PackTools/PAKPack/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ public bool Execute( string[] args )

foreach ( string file in pak.EnumerateFiles() )
{
using ( var stream = FileUtils.Create( outputPath + Path.DirectorySeparatorChar + file ) )
var normalizedFilePath = file.Replace( "../", "" ); // Remove backwards relative path
using ( var stream = FileUtils.Create( outputPath + Path.DirectorySeparatorChar + normalizedFilePath ) )
using ( var inputStream = pak.OpenFile( file ) )
{
Console.WriteLine( $"Extracting {file}" );
Expand Down Expand Up @@ -301,7 +302,7 @@ internal class ListCommand : ICommand
{
public bool Execute( string[] args )
{
if ( args.Length < 1 )
if ( args.Length < 2 )
{
Console.WriteLine( "Expected 1 argument." );
return false;
Expand Down

0 comments on commit 797b74a

Please sign in to comment.