diff options
author | joerg <joerg@FreeBSD.org> | 1995-08-06 19:35:33 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1995-08-06 19:35:33 +0000 |
commit | 5eb91064664549b5fecb5c4210728fb57572b6ae (patch) | |
tree | 159d96b1fdd67c770298cb73e9134877da44523b /bin/sh | |
parent | c4d12492fbf418f2581c171abfc398a89f17b1f2 (diff) | |
download | FreeBSD-src-5eb91064664549b5fecb5c4210728fb57572b6ae.zip FreeBSD-src-5eb91064664549b5fecb5c4210728fb57572b6ae.tar.gz |
Fix /bin/sh's broken handling of the builtin getopts(1). The options
``-ffoo'' and ``-f foo'' have been treated differently.
This has been in violation of Posix.2 (that deprecates -ffoo, but
doesn't disallow it).
Diffstat (limited to 'bin/sh')
-rw-r--r-- | bin/sh/options.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/sh/options.c b/bin/sh/options.c index 038ae5f..92e04ca 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: options.c,v 1.2 1994/09/24 02:58:04 davidg Exp $ + * $Id: options.c,v 1.3 1995/05/30 00:07:21 rgrimes Exp $ */ #ifndef lint @@ -374,12 +374,11 @@ atend: q++; } if (*++q == ':') { - if (*p == '\0' && (p = *shellparam.optnext) == NULL) { + if (*p == '\0' && (p = *shellparam.optnext++) == NULL) { out1fmt("No arg for -%c option\n", c); c = '?'; goto out; } - shellparam.optnext++; setvar("OPTARG", p, 0); p = NULL; } |