(as currently only implemented by some of the openssl(1) applications).
-/* $OpenBSD: apps.c,v 1.18 2014/12/28 15:48:52 jsing Exp $ */
+/* $OpenBSD: apps.c,v 1.19 2014/12/28 16:10:33 jsing Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
continue;
}
- if (*p == '\0') /* XXX - end of named options. */
+ /* End of named options (single hyphen). */
+ if (*p == '\0') {
+ if (++i >= argc)
+ goto done;
+ if (argsused != NULL)
+ goto done;
+ if (unnamed != NULL && i == argc - 1) {
+ if (*unnamed != NULL)
+ goto toomany;
+ *unnamed = argv[i];
+ continue;
+ }
goto unknown;
+ }
for (j = 0; opts[j].name != NULL; j++) {
opt = &opts[j];