Skip to content

Commit 22c2cae

Browse files
committed
tar archive parameter handling fixed were no path is specified.
1 parent eeaba58 commit 22c2cae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

samples/cs/tar/Main.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ public void InstanceMain(string[] argv)
161161

162162
if (this.archiveName != null && ! this.archiveName.Equals("-")) {
163163
if (operation == Operation.Create) {
164-
if (!Directory.Exists(Path.GetDirectoryName(archiveName))) {
164+
string dirName = Path.GetDirectoryName(archiveName);
165+
if ((dirName.Length > 0) && !Directory.Exists(dirName)) {
165166
Console.Error.WriteLine("Directory for archive doesnt exist");
166167
return;
167168
}

0 commit comments

Comments
 (0)