Commit 9e0c20c6 authored by Mark A. Grondona's avatar Mark A. Grondona Committed by Morris Jette
Browse files

env import: clean up bracket count code

When importing an exported shell function, the bracket count
code didn't handle negative return value from _bracket_cnt(),
so a shell function (or a shell variable starting with '(')
would loop until the end of the env output.

Since the test for no open bracket wasn't handled anyway, remove
this and clean up _bracket_cnt() code (which now returns negative
if there are more closing than opening brackets).

Also, remove the unneded local integer bracket_cnt from the while
loops and only continue processing while the bracket tally is > 0.

Note: There are still many unhandled corner cases in this code.
parent 013ac790
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment