read_file($cfg,
sub {
return if /^\#/ || /^\s*$/;
- return if $cfg eq 'configure.com' &&
- ! /^\$\s+WC "(\w+)='(.*)'"$/;
+ if ($cfg eq 'configure.com') {
+ s/(\s*!.*|\s*)$//; # remove trailing comments or whitespace
+ return if ! /^\$\s+WC "(\w+)='(.*)'"$/;
+ }
# foo='bar'
# foo=bar
# $foo='bar' # VOS 5.8.x specialty