Browse Source

Fix #537: Cannot rename file if new filename differs in capitalization only.

pull/567/head
Andreas Weizel 12 years ago
parent
commit
bcc28df4b5
  1. 14
      src/Main/SharpDevelop/Workbench/FileService.cs

14
src/Main/SharpDevelop/Workbench/FileService.cs

@ -570,7 +570,9 @@ namespace ICSharpCode.SharpDevelop.Workbench @@ -570,7 +570,9 @@ namespace ICSharpCode.SharpDevelop.Workbench
/// </summary>
public bool RenameFile(string oldName, string newName, bool isDirectory)
{
if (FileUtility.IsEqualFileName(oldName, newName))
if (string.Equals(FileUtility.NormalizePath(oldName),
FileUtility.NormalizePath(newName),
StringComparison.Ordinal))
return false;
FileChangeWatcher.DisableAllChangeWatchers();
try {
@ -580,12 +582,10 @@ namespace ICSharpCode.SharpDevelop.Workbench @@ -580,12 +582,10 @@ namespace ICSharpCode.SharpDevelop.Workbench
return false;
if (!eargs.OperationAlreadyDone) {
try {
if (FileHelpers.CheckRenameOrReplacePossible(eargs)) {
if (isDirectory) {
Directory.Move(oldName, newName);
} else {
File.Move(oldName, newName);
}
if (isDirectory) {
Directory.Move(oldName, newName);
} else {
File.Move(oldName, newName);
}
} catch (Exception e) {
if (isDirectory) {

Loading…
Cancel
Save