From 797b74aa9e86b517c263c674d7eacd2640c0da45 Mon Sep 17 00:00:00 2001 From: "Chris Weermann (TGE)" Date: Mon, 28 May 2018 07:39:55 +0200 Subject: [PATCH] [PAKPack] Trim backwards relative paths & fix argument count --- Source/PackTools/PAKPack/Program.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/PackTools/PAKPack/Program.cs b/Source/PackTools/PAKPack/Program.cs index 381c585..ea357a8 100644 --- a/Source/PackTools/PAKPack/Program.cs +++ b/Source/PackTools/PAKPack/Program.cs @@ -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}" ); @@ -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;