From 75acb04d6c797f4a0ae1f54610c2873ce2838391 Mon Sep 17 00:00:00 2001 From: Federico Blaseotto Date: Thu, 3 Oct 2024 00:20:08 +0200 Subject: [PATCH] Checking path Ubuntu test --- sources/OpenMcdf/CompoundFile.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sources/OpenMcdf/CompoundFile.cs b/sources/OpenMcdf/CompoundFile.cs index d61efef6..87ed2c00 100644 --- a/sources/OpenMcdf/CompoundFile.cs +++ b/sources/OpenMcdf/CompoundFile.cs @@ -1756,24 +1756,30 @@ public void SaveAs(string fileName) { if (Path.IsPathRooted(fileName)) { - Debug.WriteLine("Path is rooted. Filename:"+ fileName); + Debug.WriteLine("Path is rooted"); + Debug.WriteLine("Filename:"+ fileName); Debug.WriteLine("Stream name:"+ stream.Name); + Debug.WriteLine("Stream name equals filename? :" + (stream.Name == fileName)); + if (stream.Name == fileName) { - Debug.WriteLine("Filename equals stream name:"+ stream.Name); + Debug.WriteLine("-> Filename equals stream name"); raiseSaveFileEx = true; } } else { - Debug.WriteLine("Path is NOT rooted. Filename:"+ fileName); + Debug.WriteLine("Path is NOT rooted"); + Debug.WriteLine("Filename:"+ fileName); + Debug.WriteLine("Filename modified:"+ (Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\" + fileName)); Debug.WriteLine("Directory name:"+ Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)); - Debug.WriteLine("Path is NOT rooted. Stream name:"+ stream.Name); - + Debug.WriteLine("Stream name:"+ stream.Name); + Debug.WriteLine("Stream name equals filename? :" + (stream.Name == (Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\" + fileName))); + if (stream.Name == (Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\" + fileName)) { - Debug.WriteLine("Filename equals stream name:"+ stream.Name); + Debug.WriteLine("-> Filename equals stream name:"); raiseSaveFileEx = true; }