https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7a2c1f7d0bdd93474ff1b…
commit 7a2c1f7d0bdd93474ff1b57dd77c7277e6b8bba3
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Wed Sep 30 19:24:52 2020 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Oct 11 17:01:06 2020 +0200
[RAPPS] Re-add support for icons named after the ini file
---
base/applications/rapps/available.cpp | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/base/applications/rapps/available.cpp
b/base/applications/rapps/available.cpp
index d32e5f8d74a..6de168024dd 100644
--- a/base/applications/rapps/available.cpp
+++ b/base/applications/rapps/available.cpp
@@ -92,18 +92,32 @@ VOID
CAvailableApplicationInfo::RetrieveGeneralInfo(AvailableStrings& AvlbString
}
}
+ ATL::CStringW IconPath = AvlbStrings.szAppsPath;
+ PathAppendW(IconPath.GetBuffer(MAX_PATH), L"icons");
+
// TODO: are we going to support specify an URL for an icon ?
ATL::CStringW IconLocation;
if (GetString(L"Icon", IconLocation))
{
- // TODO: Does the filename contain anything stuff like ":"
"<" ">" ?
- // these stuff may lead to security issues
- ATL::CStringW IconPath = AvlbStrings.szAppsPath;
- PathAppendW(IconPath.GetBuffer(MAX_PATH), L"icons");
BOOL bSuccess = PathAppendNoDirEscapeW(IconPath.GetBuffer(),
IconLocation.GetString());
IconPath.ReleaseBuffer();
- if (bSuccess)
+ if (!bSuccess)
+ {
+ IconPath.Empty();
+ }
+ }
+ else
+ {
+ // inifile.ico
+ PathAppendW(IconPath.GetBuffer(), m_szPkgName);
+ IconPath.ReleaseBuffer();
+ IconPath += L".ico";
+ }
+
+ if (!IconPath.IsEmpty())
+ {
+ if (PathFileExistsW(IconPath))
{
m_szIconLocation = IconPath;
}