Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion LibNoDaveConnectionLibrary/Projectfiles/Step7ProjectV5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ public Step7ProjectV5(string projectfile, bool showDeleted, Encoding prEn)
}

ProjectFile = projectfile;
ProjectFolder = _projectfilename.Substring(0, _projectfilename.LastIndexOf(_DirSeperator)) + _DirSeperator;
ProjectFolder = "";

// Check if the s7p file is at the root level (so no / in the path) or in a subfolder and set the ProjectFolder accordingly
if (_projectfilename.IndexOf(_DirSeperator) != -1)
{
ProjectFolder = _projectfilename.Substring(0, _projectfilename.LastIndexOf(_DirSeperator)) + _DirSeperator;
}

ProjectEncoding = (prEn ?? Encoding.GetEncoding("ISO-8859-1"));
var lngFile = _ziphelper.GetReadStream(ProjectFolder + "Global" + _DirSeperator + "Language");
Expand Down
Loading