=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/dc/dc.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- src/usr.bin/dc/dc.c 2015/11/03 04:58:58 1.17 +++ src/usr.bin/dc/dc.c 2016/07/17 17:30:47 1.18 @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.17 2015/11/03 04:58:58 mmcc Exp $ */ +/* $OpenBSD: dc.c,v 1.18 2016/07/17 17:30:47 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek @@ -50,6 +50,8 @@ if ((buf = strdup("")) == NULL) err(1, NULL); /* accept and ignore a single dash to be 4.4BSD dc(1) compatible */ + optind = 1; + optreset = 1; while ((ch = getopt(argc, argv, "e:x-")) != -1) { switch (ch) { case 'e':