diff --git a/CommandLine.c b/CommandLine.c index ad0fade0..7365d731 100644 --- a/CommandLine.c +++ b/CommandLine.c @@ -46,7 +46,8 @@ static char *NxtTokenPtr; //------------------------------------------------------------------- // Parse the VCC command string and set IniFilePath, QuickLoadFile, and -// possibly other things. These Variables are globals defined in config.h +// possibly other things. Variables set by this routine are global and +// are defined in CommandLine.h // // vcc.exe [-d[level]] [-i IniFile] [QuickLoadFile] // @@ -67,6 +68,11 @@ int CommandLineSettings(char *CmdString) static char * ValueRequired = "i"; + // Initialize the global variables set by this routine + *QuickLoadFile = '\0'; + *IniFilePath = '\0'; + ConsoleLogging = 0; + // Get the first token from the command string token = ParseCmdString(CmdString,ValueRequired); while (token) { @@ -207,4 +213,3 @@ char *GetNextToken () // Return address of current token return token; } - diff --git a/CommandLine.h b/CommandLine.h index 46bb9334..350fd9d7 100644 --- a/CommandLine.h +++ b/CommandLine.h @@ -1,6 +1,10 @@ #ifndef __COMMANDLINE_H__ #define __COMMANDLINE_H__ +#ifdef __cplusplus +extern "C" { +#endif + /* Copyright 2015 by E J Jaquay This file is part of VCC (Virtual Color Computer). @@ -26,9 +30,14 @@ This file is part of VCC (Virtual Color Computer). char QuickLoadFile[MAX_PATH]; char IniFilePath[MAX_PATH]; -int ConsoleLogging = 0; +int ConsoleLogging; // Get Settings from Command line string (lpCmdLine from WinMain) int CommandLineSettings(char *); +#ifdef __cplusplus +} #endif + +#endif +