From: jsg Date: Sun, 11 Jun 2023 12:35:00 +0000 (+0000) Subject: remove chopup_args() unused since apps.c rev 1.31 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a442546f586999ba7fdd73a7674f15982e434480;p=openbsd remove chopup_args() unused since apps.c rev 1.31 ok tb@ --- diff --git a/usr.bin/openssl/apps.c b/usr.bin/openssl/apps.c index f5f1248c078..44b304a98b7 100644 --- a/usr.bin/openssl/apps.c +++ b/usr.bin/openssl/apps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apps.c,v 1.64 2023/04/22 20:50:26 tb Exp $ */ +/* $OpenBSD: apps.c,v 1.65 2023/06/11 12:35:00 jsg Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -199,75 +199,6 @@ program_name(char *in, char *out, int size) strlcpy(out, p, size); } -int -chopup_args(ARGS *arg, char *buf, int *argc, char **argv[]) -{ - int num, i; - char *p; - - *argc = 0; - *argv = NULL; - - if (arg->count == 0) { - arg->count = 20; - arg->data = reallocarray(NULL, arg->count, sizeof(char *)); - if (arg->data == NULL) - return 0; - } - for (i = 0; i < arg->count; i++) - arg->data[i] = NULL; - - num = 0; - p = buf; - for (;;) { - /* first scan over white space */ - if (!*p) - break; - while (*p && ((*p == ' ') || (*p == '\t') || (*p == '\n'))) - p++; - if (!*p) - break; - - /* The start of something good :-) */ - if (num >= arg->count) { - char **tmp_p; - int tlen = arg->count + 20; - tmp_p = reallocarray(arg->data, tlen, sizeof(char *)); - if (tmp_p == NULL) - return 0; - arg->data = tmp_p; - arg->count = tlen; - /* initialize newly allocated data */ - for (i = num; i < arg->count; i++) - arg->data[i] = NULL; - } - arg->data[num++] = p; - - /* now look for the end of this */ - if ((*p == '\'') || (*p == '\"')) { /* scan for closing - * quote */ - i = *(p++); - arg->data[num - 1]++; /* jump over quote */ - while (*p && (*p != i)) - p++; - *p = '\0'; - } else { - while (*p && ((*p != ' ') && - (*p != '\t') && (*p != '\n'))) - p++; - - if (*p == '\0') - p--; - else - *p = '\0'; - } - p++; - } - *argc = num; - *argv = arg->data; - return (1); -} - int dump_cert_text(BIO *out, X509 *x) { diff --git a/usr.bin/openssl/apps.h b/usr.bin/openssl/apps.h index 82e0662c886..addc6b031f5 100644 --- a/usr.bin/openssl/apps.h +++ b/usr.bin/openssl/apps.h @@ -1,4 +1,4 @@ -/* $OpenBSD: apps.h,v 1.32 2023/04/14 15:27:13 tb Exp $ */ +/* $OpenBSD: apps.h,v 1.33 2023/06/11 12:35:00 jsg Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -159,7 +159,6 @@ int should_retry(int i); int args_from_file(char *file, int *argc, char **argv[]); int str2fmt(char *s); void program_name(char *in, char *out, int size); -int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[]); #ifdef HEADER_X509_H int dump_cert_text(BIO *out, X509 *x); void print_name(BIO *out, const char *title, X509_NAME *nm,