From 5369be5079fb66300e63d3a52a7735e1504b7073 Mon Sep 17 00:00:00 2001 From: Hartmut Becker Date: Sun, 31 Aug 2014 19:11:08 +0200 Subject: Enhance/fix VMS setting of program name, MAKE/MAKE_COMMAND variables * default.c, main.c, makeint.h, vmsfunctions.c: prefix argv[0] with "mcr " for MAKE/MAKE_COMMAND and set the program name to the image filename (without the .exe;version) * vmsfunctions.c: remove obsolete code * vmsify: use xmalloc --- vmsify.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'vmsify.c') diff --git a/vmsify.c b/vmsify.c index c87d68c..cc90485 100644 --- a/vmsify.c +++ b/vmsify.c @@ -22,6 +22,8 @@ this program. If not, see . */ #include #include +#include "makeint.h" + #if VMS #include #include @@ -137,9 +139,7 @@ trnlog (const char *name) } reslt[resltlen] = '\0'; - s = malloc (resltlen+1); - if (s == 0) - return ""; + s = xmalloc (resltlen+1); strcpy (s, reslt); return s; } @@ -221,10 +221,11 @@ vmsify (const char *name, int type) max 39 filetype max 5 version */ -#define MAXPATHLEN 512 +/* todo: VMSMAXPATHLEN is defined for ODS2 names: it needs to be adjusted. */ +#define VMSMAXPATHLEN 512 enum namestate nstate; - static char vmsname[MAXPATHLEN+1]; + static char vmsname[VMSMAXPATHLEN+1]; const char *fptr; const char *t; char *vptr; @@ -402,9 +403,9 @@ vmsify (const char *name, int type) fptr++; if (*fptr == 0) /* just // */ { - char cwdbuf[MAXPATHLEN+1]; + char cwdbuf[VMSMAXPATHLEN+1]; - s1 = getcwd(cwdbuf, MAXPATHLEN); + s1 = getcwd(cwdbuf, VMSMAXPATHLEN); if (s1 == 0) { vmsname[0] = '\0'; @@ -796,9 +797,9 @@ vmsify (const char *name, int type) } { /* got '..' or '../' */ char *vp; - char cwdbuf[MAXPATHLEN+1]; + char cwdbuf[VMSMAXPATHLEN+1]; - vp = getcwd(cwdbuf, MAXPATHLEN); + vp = getcwd(cwdbuf, VMSMAXPATHLEN); if (vp == 0) { vmsname[0] = '\0'; @@ -856,9 +857,9 @@ vmsify (const char *name, int type) { char *vp; - char cwdbuf[MAXPATHLEN+1]; + char cwdbuf[VMSMAXPATHLEN+1]; - vp = getcwd(cwdbuf, MAXPATHLEN); + vp = getcwd(cwdbuf, VMSMAXPATHLEN); if (vp == 0) { vmsname[0] = '\0'; -- cgit v1.2.3