Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: KSP-CKAN/CKAN
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b75a4502c1e5
Choose a base ref
...
head repository: KSP-CKAN/CKAN
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f45d0141f875
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Feb 27, 2018

  1. Copy the full SHA
    6b14299 View commit details

Commits on Mar 4, 2018

  1. Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    f45d014 View commit details
Showing with 10 additions and 6 deletions.
  1. +1 −0 CHANGELOG.md
  2. +9 −6 Core/KSPPathUtils.cs
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
- [GUI] Fix GUI sort by size (#2311 by: HebaruSan; reviewed: politas)
- [Core] Don't crash if download_hash isn't set (#2313 by: HebaruSan; reviewed: politas)
- [GUI] Fix GUI instance name checking (#2316 by: HebaruSan; reviewed: politas)
- [Core] Fix ArgumentOutOfRangeException when removing files from game root (#2332 by: HebaruSan; reviewed: politas)

## v1.24.0 (Bruce)

15 changes: 9 additions & 6 deletions Core/KSPPathUtils.cs
Original file line number Diff line number Diff line change
@@ -144,7 +144,7 @@ public static string KSPSteamPath()
// Found Steam library
if (line.Contains("BaseInstallFolder"))
{

// This assumes config file is valid, we just skip it if it looks funny.
string[] split_line = line.Split('"');

@@ -189,7 +189,7 @@ public static string GetLastPathElement(string path)

/// <summary>
/// Gets the leading path elements. Ex: /a/b/c returns /a/b
///
///
/// Returns empty string if there is no leading path. (Eg: "Example.dll" -> "");
/// </summary>
/// <returns>The leading path elements.</returns>
@@ -242,10 +242,13 @@ public static string ToRelative(string path, string root)
)
);
}

// The +1 here is because root will never have
// a trailing slash.
return path.Remove(0, root.Length + 1);
// a trailing slash. However, if the strings are
// the same, it causes an exception.
return path.Length > root.Length
? path.Remove(0, root.Length + 1)
: "";
}

/// <summary>
@@ -285,4 +288,4 @@ public static string ToAbsolute(string path, string root)
return NormalizePath(Path.Combine(root, path));
}
}
}
}