mirror of
https://github.com/dylanaraps/pure-sh-bible
synced 2024-06-08 08:42:29 +02:00
Fix a bug in lines() (after a year of its discovery!)
Some time ago, about a year ago, i discovered a bug at `lines()` when incorporating it in a Shell library of mine. Basically, when you ran for the first time, it stored a integer with the number of lines in the `${lines}` variable, which is the expect. But, when you ran it for the second time, it started adding the value of `${lines}`, from the first run, with the value of the current run. The fix to this is very simple, just add `unset` at the end of the function. I had been wanting to do a pull request for a while to fix this, but i've ran out of time and ended up forgetting about it. I hope it helps now.
This commit is contained in:
parent
cd6e426a50
commit
daa7772ad2