summaryrefslogtreecommitdiffstats
path: root/apps/vms_decc_init.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-03-03 10:20:37 +0100
committerRichard Levitte <levitte@openssl.org>2019-03-05 08:51:09 +0100
commit9b542d72d2e7d4893a11b2e87628d9ac8637b954 (patch)
tree6d57a2ff528849c7208edb9797bc35f2db35f9de /apps/vms_decc_init.c
parent469ce8ff48ef06b2e508d0c06a42ec86379b0032 (diff)
VMS: move copy_argc to its own module and make it an aux source
copy_argv was never initialization code. Make it self-cleaning too. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8381)
Diffstat (limited to 'apps/vms_decc_init.c')
-rw-r--r--apps/vms_decc_init.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/apps/vms_decc_init.c b/apps/vms_decc_init.c
index c26442e440..21481e27bf 100644
--- a/apps/vms_decc_init.c
+++ b/apps/vms_decc_init.c
@@ -25,8 +25,6 @@
# include <stdlib.h>
# include <unixlib.h>
-# include "apps.h"
-
/* Global storage. */
/* Flag to sense if decc_init() was called. */
@@ -63,42 +61,6 @@ decc_feat_t decc_feat_array[] = {
};
-char **copy_argv(int *argc, char *argv[])
-{
- /*-
- * The note below is for historical purpose. On VMS now we always
- * copy argv "safely."
- *
- * 2011-03-22 SMS.
- * If we have 32-bit pointers everywhere, then we're safe, and
- * we bypass this mess, as on non-VMS systems.
- * Problem 1: Compaq/HP C before V7.3 always used 32-bit
- * pointers for argv[].
- * Fix 1: For a 32-bit argv[], when we're using 64-bit pointers
- * everywhere else, we always allocate and use a 64-bit
- * duplicate of argv[].
- * Problem 2: Compaq/HP C V7.3 (Alpha, IA64) before ECO1 failed
- * to NULL-terminate a 64-bit argv[]. (As this was written, the
- * compiler ECO was available only on IA64.)
- * Fix 2: Unless advised not to (VMS_TRUST_ARGV), we test a
- * 64-bit argv[argc] for NULL, and, if necessary, use a
- * (properly) NULL-terminated (64-bit) duplicate of argv[].
- * The same code is used in either case to duplicate argv[].
- * Some of these decisions could be handled in preprocessing,
- * but the code tends to get even uglier, and the penalty for
- * deciding at compile- or run-time is tiny.
- */
-
- int i, count = *argc;
- char **newargv = app_malloc(sizeof(*newargv) * (count + 1), "argv copy");
-
- for (i = 0; i < count; i++)
- newargv[i] = argv[i];
- newargv[i] = NULL;
- *argc = i;
- return newargv;
-}
-
/* LIB$INITIALIZE initialization function. */
static void decc_init(void)