1
0
Fork 0

Fix a bug where a test was perfromed on a variable that wasn;'t even initialized (and wrong) and add support for tab and space as a seperator

This commit is contained in:
ehofman 2003-08-18 09:26:26 +00:00
parent 0caaeffbc6
commit a3fb470f7c

View file

@ -62,19 +62,27 @@ FGGeneric::FGGeneric(string& config) {
var_sep_string = output->getStringValue("var_separator"); var_sep_string = output->getStringValue("var_separator");
line_sep_string = output->getStringValue("line_separator"); line_sep_string = output->getStringValue("line_separator");
if ( var_separator == "newline" ) if ( var_sep_string == "newline" )
var_separator = '\n'; var_separator = '\n';
else if ( var_separator == "formfeed" ) else if ( var_sep_string == "tab" )
var_separator = '\t';
else if ( var_sep_string == "space" )
var_separator = ' ';
else if ( var_sep_string == "formfeed" )
var_separator = '\f'; var_separator = '\f';
else if ( var_separator == "carriagereturn" ) else if ( var_sep_string == "carriagereturn" )
var_separator = '\r'; var_sep_string = '\r';
else if ( var_separator == "verticaltab" ) else if ( var_sep_string == "verticaltab" )
var_separator = '\v'; var_separator = '\v';
else else
var_separator = var_sep_string; var_separator = var_sep_string;
if ( line_sep_string == "newline" ) if ( line_sep_string == "newline" )
line_separator = '\n'; line_separator = '\n';
if ( line_sep_string == "tab" )
line_separator = '\t';
if ( line_sep_string == "space" )
line_separator = ' ';
else if ( line_sep_string == "formfeed" ) else if ( line_sep_string == "formfeed" )
line_separator = '\f'; line_separator = '\f';
else if ( line_sep_string == "carriagereturn" ) else if ( line_sep_string == "carriagereturn" )
@ -131,7 +139,7 @@ bool FGGeneric::gen_message() {
for (unsigned int i = 0; i < _message.size(); i++) { for (unsigned int i = 0; i < _message.size(); i++) {
if (i > 0) if (i > 0)
generic_sentence += line_separator; generic_sentence += var_separator;
switch (_message[i].type) { switch (_message[i].type) {
case FG_INT: case FG_INT: