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