From fa22a7a84bdc91d0481bf538d3b78a524f1cc213 Mon Sep 17 00:00:00 2001 From: konekoneko Date: Thu, 18 Oct 2012 18:50:29 +0900 Subject: [PATCH] =?utf8?q?=E5=89=8A=E9=99=A4=E5=AE=8C=E4=BA=86=E6=99=82?= =?utf8?q?=E3=81=AB=E4=BE=8B=E5=A4=96=E3=81=8C=E7=99=BA=E7=94=9F=E3=81=99?= =?utf8?q?=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C=E3=81=82=E3=82=8B=E7=82=B9?= =?utf8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F=20wchat=5Ft?= =?utf8?q?=E3=81=AE=E3=82=B5=E3=82=A4=E3=82=BA=E3=81=8C=E6=AD=A3=E3=81=97?= =?utf8?q?=E3=81=8F=E6=B1=82=E3=82=81=E3=82=89=E3=82=8C=E3=81=A6=E3=81=84?= =?utf8?q?=E3=81=AA=E3=81=84=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= =?utf8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- CompleteEraser/MainForm.cs | 18 +----------------- CompleteEraser/SharedInfo.cs | 3 ++- ShellExtension/ContextMenu.cpp | 2 +- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/CompleteEraser/MainForm.cs b/CompleteEraser/MainForm.cs index 9b8a869..3a6461f 100644 --- a/CompleteEraser/MainForm.cs +++ b/CompleteEraser/MainForm.cs @@ -77,7 +77,7 @@ namespace CompleteEraser if (e.fileName == null) this.label2.Text = Resources.FINAL_PROCESS; else - this.label2.Text = string.Format(Resources.FILE_PROCESS, this.TrimFullPath(e.fileName)); + this.label2.Text = string.Format(Resources.FILE_PROCESS, Path.GetFileName(e.fileName)); } void op_Progressed(object sender, ProgressedEventArgs e) @@ -133,21 +133,5 @@ namespace CompleteEraser this.info.Dispose(); } - public string TrimFullPath(string filepath) - { - if (filepath == null || filepath == "") - return string.Empty; - string DirectoryPart = Path.GetDirectoryName(filepath); - string FilenamePart = Path.GetFileName(filepath); - string[] slice = DirectoryPart.Split('\\'); - if (slice.Length > 3) - { - DirectoryPart = slice[0] + "\\..\\" + slice[slice.Length - 1]; - return DirectoryPart + "\\" + FilenamePart; - } - else - return filepath; - } - } } diff --git a/CompleteEraser/SharedInfo.cs b/CompleteEraser/SharedInfo.cs index 820cb99..1bd5d6c 100644 --- a/CompleteEraser/SharedInfo.cs +++ b/CompleteEraser/SharedInfo.cs @@ -23,7 +23,8 @@ namespace CompleteEraser while (sr.EndOfStream == false) { string s = sr.ReadLine(); - yield return s; + if(s != string.Empty && s[0] != '\0') + yield return s; } } finally diff --git a/ShellExtension/ContextMenu.cpp b/ShellExtension/ContextMenu.cpp index 3c9f007..61a9c85 100644 --- a/ShellExtension/ContextMenu.cpp +++ b/ShellExtension/ContextMenu.cpp @@ -150,7 +150,7 @@ STDMETHODIMP CContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO pici) if (menutype == ClearFileNames) { - UINT mapSize = this->strs.length() * 2; + UINT mapSize = this->strs.length() * sizeof(wchar_t); m_hMapping = ::CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, -- 2.11.0