Re: [PATCH] OPTIND in funsub

2023-11-28 Thread Chet Ramey
On 11/28/23 1:14 AM, Grisha Levit wrote: If a funsub declares a local OPTIND, the calling context's getopts state gets messed up. Thanks for the reports and patches. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates

[PATCH] OPTIND in funsub

2023-11-27 Thread Grisha Levit
If a funsub declares a local OPTIND, the calling context's getopts state gets messed up. For example, the following loop will not terminate: OPTIND=1; while getopts ab opt -ab; do echo $opt ${ local OPTIND; } done From f7f16f70cf0ef623541ff3b6a36cff10b4933914 Mon Sep 17 00:00:00