From b4939ff04befbf1a10e4996b31070d43c30bbb29 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Sun, 27 Aug 2017 15:13:57 +0300 Subject: [PATCH] Minor code refactoring: Renamed variable --- .../Adapter/NTFileSystemAdapter.Set.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.Set.cs b/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.Set.cs index 5ccdfc6..94f2d85 100644 --- a/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.Set.cs +++ b/SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.Set.cs @@ -48,10 +48,10 @@ namespace SMBLibrary else if (information is FileRenameInformationType2) { FileRenameInformationType2 renameInformation = (FileRenameInformationType2)information; - string destination = renameInformation.FileName; - if (!destination.StartsWith(@"\")) + string newFileName = renameInformation.FileName; + if (!newFileName.StartsWith(@"\")) { - destination = @"\" + destination; + newFileName = @"\" + newFileName; } if (fileHandle.Stream != null) @@ -62,20 +62,20 @@ namespace SMBLibrary // Note: it's possible that we just want to upcase / downcase a filename letter. try { - if (renameInformation.ReplaceIfExists && (m_fileSystem.GetEntry(destination) != null)) + if (renameInformation.ReplaceIfExists && (m_fileSystem.GetEntry(newFileName) != null)) { - m_fileSystem.Delete(destination); + m_fileSystem.Delete(newFileName); } - m_fileSystem.Move(fileHandle.Path, destination); - Log(Severity.Information, "SetFileInformation: Renamed '{0}' to '{1}'", fileHandle.Path, destination); + m_fileSystem.Move(fileHandle.Path, newFileName); + Log(Severity.Information, "SetFileInformation: Renamed '{0}' to '{1}'", fileHandle.Path, newFileName); } catch (Exception ex) { NTStatus status = ToNTStatus(ex); - Log(Severity.Verbose, "SetFileInformation: Cannot rename '{0}' to '{1}'. {2}.", fileHandle.Path, destination, status); + Log(Severity.Verbose, "SetFileInformation: Cannot rename '{0}' to '{1}'. {2}.", fileHandle.Path, newFileName, status); return status; } - fileHandle.Path = destination; + fileHandle.Path = newFileName; return NTStatus.STATUS_SUCCESS; } else if (information is FileDispositionInformation)