Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variables not expanded in vhier -f files #298

Closed
veripoolbot opened this issue Nov 1, 2010 · 2 comments
Closed

Environment variables not expanded in vhier -f files #298

veripoolbot opened this issue Nov 1, 2010 · 2 comments
Assignees

Comments

@veripoolbot
Copy link
Collaborator


Author Name: John Dickol
Original Redmine Issue: 298 from https://www.veripool.org
Original Date: 2010-11-01
Original Assignee: Wilson Snyder (@wsnyder)


Environment variables are not being expanded when I use them in a file read in with -f. The problem appears to be due to Getopt::Long calling the subroutine associated with "<>" with a object reference, not a string for the unrecognised parameter. (See http://search.cpan.org/~jv/Getopt-Long-2.38/lib/Getopt/Long.pm#Argument_callback ) This object doesn't work as expected in the regular expression in sub file_substitute in Verilog/Getopt.pm.

To fix it: double quote the $param variable before pushing it onto the @opt_files array in vhier (and vppreproc, etc.)

sub parameter {
     my $param = shift;
     if ($param =~ /^--?/) {
         die "%Error: vhier: Unknown parameter: $param\n";
     } else {
         #push @opt_files, $param;
         push @opt_files, "$param";
     }
}

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2010-11-02T00:06:20Z


Wow, it's amazing I didn't know that getopt issue!

Fixed, and in a bunch of other places too, just to be safe.

In git for 3.305+.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2010-12-03T20:28:01Z


In 3.305.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants