* Modifications copyright (c) 2012-2015 Roderick W. Smith
*
* Modifications distributed under the terms of the GNU General Public
- * License (GPL) version 3 (GPLv3), a copy of which must be distributed
- * with this source code or binaries made from it.
+ * License (GPL) version 3 (GPLv3), or (at your option) any later version.
*
*/
+/*
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
#include "global.h"
#include "config.h"
if (AboutMenu.EntryCount == 0) {
AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
- AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.9.1.2");
+ AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.9.2");
AddMenuInfoLine(&AboutMenu, L"");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith");
// If an error is encountered, leaves the value alone (it should be set to
// CONFIG_FILE_NAME when GlobalConfig is initialized).
static VOID SetConfigFilename(EFI_HANDLE ImageHandle) {
-EFI_LOADED_IMAGE *Info;
-CHAR16 *Options, *FileName;
-EFI_STATUS Status;
-INTN Where;
+ EFI_LOADED_IMAGE *Info;
+ CHAR16 *Options, *FileName, *SubString;
+ EFI_STATUS Status;
-Status = refit_call3_wrapper(BS->HandleProtocol, ImageHandle, &LoadedImageProtocol, (VOID **) &Info);
+ Status = refit_call3_wrapper(BS->HandleProtocol, ImageHandle, &LoadedImageProtocol, (VOID **) &Info);
if ((Status == EFI_SUCCESS) && (Info->LoadOptionsSize > 0)) {
Options = (CHAR16 *) Info->LoadOptions;
- Where = FindSubString(L" -c ", Options);
- if (Where >= 0) {
- FileName = StrDuplicate(&Options[Where + 4]);
- Where = FindSubString(L" ", FileName);
- if (Where > 0)
- FileName[Where] = L'\0';
+ SubString = MyStrStr(Options, L" -c ");
+ if (SubString) {
+ FileName = StrDuplicate(&SubString[4]);
+ if (FileName) {
+ LimitStringLength(FileName, 256);
+ }
if (FileExists(SelfDir, FileName)) {
GlobalConfig.ConfigFilename = FileName;