From 3022b665dd8d66aad2a1ce216534fe76a6bdc5ca Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 27 Jun 2014 16:43:51 -0400 Subject: [PATCH] Initialized the mask variable. Moved the FPERM_ defines into the .cpp and removed the header file. --- core/logic/smn_filesystem.cpp | 13 ++++++++-- core/logic/smn_filesystem.h | 45 ----------------------------------- 2 files changed, 11 insertions(+), 47 deletions(-) delete mode 100644 core/logic/smn_filesystem.h diff --git a/core/logic/smn_filesystem.cpp b/core/logic/smn_filesystem.cpp index fb785c09..0fb7b16e 100644 --- a/core/logic/smn_filesystem.cpp +++ b/core/logic/smn_filesystem.cpp @@ -41,7 +41,16 @@ #if defined PLATFORM_WINDOWS #include -#include "smn_filesystem.h" + +#define FPERM_U_READ 0x0100 /* User can read. */ +#define FPERM_U_WRITE 0x0080 /* User can write. */ +#define FPERM_U_EXEC 0x0040 /* User can exec. */ +#define FPERM_G_READ 0x0020 /* Group can read. */ +#define FPERM_G_WRITE 0x0010 /* Group can write. */ +#define FPERM_G_EXEC 0x0008 /* Group can exec. */ +#define FPERM_O_READ 0x0004 /* Anyone can read. */ +#define FPERM_O_WRITE 0x0002 /* Anyone can write. */ +#define FPERM_O_EXEC 0x0001 /* Anyone can exec. */ #endif HandleType_t g_FileType; @@ -479,7 +488,7 @@ static cell_t sm_SetFilePermissions(IPluginContext *pContext, const cell_t *para g_pSM->BuildPath(Path_Game, realpath, sizeof(realpath), "%s", name); #if defined PLATFORM_WINDOWS - int mask; + int mask = 0; if (params[2] & FPERM_U_WRITE || params[2] & FPERM_G_WRITE || params[2] & FPERM_O_WRITE) { mask |= _S_IWRITE; diff --git a/core/logic/smn_filesystem.h b/core/logic/smn_filesystem.h deleted file mode 100644 index e40c03dc..00000000 --- a/core/logic/smn_filesystem.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * 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 . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -#ifndef _INCLUDE_SOURCEMOD_FILESYSTEM_H_ -#define _INCLUDE_SOURCEMOD_FILESYSTEM_H_ - -#define FPERM_U_READ 0x0100 /* User can read. */ -#define FPERM_U_WRITE 0x0080 /* User can write. */ -#define FPERM_U_EXEC 0x0040 /* User can exec. */ -#define FPERM_G_READ 0x0020 /* Group can read. */ -#define FPERM_G_WRITE 0x0010 /* Group can write. */ -#define FPERM_G_EXEC 0x0008 /* Group can exec. */ -#define FPERM_O_READ 0x0004 /* Anyone can read. */ -#define FPERM_O_WRITE 0x0002 /* Anyone can write. */ -#define FPERM_O_EXEC 0x0001 /* Anyone can exec. */ - -#endif //_INCLUDE_SOURCEMOD_FILESYSTEM_H_