From 1789ad83243ac0436f3d65a12937288ce521479b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 18 Apr 2005 19:50:33 +0000 Subject: [PATCH] Fixed bug where blank lines were read as plugins Fixed bug where newlines weren't stripped in config file --HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%4022 --- sourcemm/sourcemm.cpp | 6 ++++++ sourcemm/sourcemm.vcproj | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sourcemm/sourcemm.cpp b/sourcemm/sourcemm.cpp index 8f619a1..902a861 100644 --- a/sourcemm/sourcemm.cpp +++ b/sourcemm/sourcemm.cpp @@ -296,10 +296,16 @@ int LoadPluginsFromFile(const char *file) char buffer[255], error[255], full_path[128]; const char *ptr, *ext; + size_t length; while (!feof(fp)) { buffer[0] = '\0'; fgets(buffer, sizeof(buffer)-1, fp); + length = strlen(buffer); + if (!length) + continue; + if (buffer[length-1] == '\n') + buffer[length-1] = '\0'; if (buffer[0] == ';' || strncmp(buffer, "//", 2) == 0) continue; //First find if it's an absolute path or not... diff --git a/sourcemm/sourcemm.vcproj b/sourcemm/sourcemm.vcproj index 0bb6731..5d544c5 100644 --- a/sourcemm/sourcemm.vcproj +++ b/sourcemm/sourcemm.vcproj @@ -87,7 +87,7 @@ AdditionalDependencies="tier0.lib vstdlib.lib" OutputFile="$(OutDir)/server.dll" LinkIncremental="1" - GenerateDebugInformation="TRUE" + GenerateDebugInformation="FALSE" SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2"