Opened 14 years ago

Closed 14 years ago

Last modified 5 years ago

#10 closed defect (fixed)

Comments in cfg files cannot be properly handled for string parameters

Reported by: li@… Owned by: davidf
Priority: minor Milestone:
Component: HM Version:
Keywords: Cc: fbossen, ksuehring, davidf, jct-vc@…

Description

The comments in cfg files cannot be removed from the value strings. Normally, it doesn't matter. But for string parameters like "InputFile", the comment after the parameter will be treated as a part of the parameter. A possible solution may be the following revision in bool TAppOption::setValue( const char *option , char *value )

for( int i = 0 ; i < option_counter ; i++ ){

if( strcmp( options[i], option ) == 0 ){

lines for bug fixing
char * pComment = strchr( value , comment );
if( pComment != NULL )

*pComment = 0;

value = chomp( value );
lines for bug fixing

values[ optionindex[i] ] = (char*) malloc((strlen(value)+1)*sizeof(char));
strcpy( values[ optionindex[i] ], value );

return true;

}

}

Change History (5)

comment:1 Changed 14 years ago by ksuehring

  • Owner set to davidf
  • Status changed from new to assigned

comment:2 Changed 14 years ago by davidf

  • Resolution set to fixed
  • Status changed from assigned to closed

This has been resolved in r61, with unified config and command line handling.
The following examples will all give the same result ("some string"):

  • "Foo: some string"
  • "Foo: some string #comment"
  • "Foo:some string"
  • "Foo: some string "

Hash (#) characters must appear after whitespace for them to be treated as marking the start of a comment.
Eg, "Foo: some string#comment" evaluates to "some string#comment".

comment:3 Changed 12 years ago by davidf

  • Component set to HM

Updating component after adding WD (Text) tickets

comment:4 Changed 12 years ago by davidf

  • Cc fbossen ksuehring davidf added

comment:5 Changed 12 years ago by davidf

  • Cc jct-vc@… added
Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Owner, Subscriber, Participant

  • David Flynn(Owner, Subscriber, Participant)
  • Frank Bossen(Subscriber)
  • jct-vc@…(Subscriber)
  • karl.sharman@…(Always)
  • Karsten Suehring(Subscriber, Participant, Always)
  • li@…(Reporter)