bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] OPTIND in funsub


From: Grisha Levit
Subject: [PATCH] OPTIND in funsub
Date: Tue, 28 Nov 2023 01:14:28 -0500

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

Attachment: 0001-restore-getopt-state-after-funsub.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]