X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/54bd0db43634c649d13e175384e6e816c44a34d4..95e742f7788b820def4e8c6af9e3e8c76691f220:/src/files.c?ds=inline diff --git a/src/files.c b/src/files.c index 00342429..020111f5 100644 --- a/src/files.c +++ b/src/files.c @@ -18,7 +18,7 @@ along with Bison; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifdef VMS +#if defined (VMS) & !defined (__VMS_POSIX) #include #define unlink delete #ifndef XPFILE @@ -108,7 +108,7 @@ openfiles() int base_length; int short_base_length; -#ifdef VMS +#if defined (VMS) & !defined (__VMS_POSIX) char *tmp_base = "sys$scratch:b_"; #else char *tmp_base = "/tmp/b."; @@ -150,7 +150,7 @@ openfiles() short_base_length = strlen (spec_file_prefix); /* Count room for `.tab'. */ base_length = short_base_length + 4; - name_base = (char *) mallocate (base_length + 1); + name_base = (char *) xmalloc (base_length + 1); /* Append `.tab'. */ strcpy (name_base, spec_file_prefix); #ifdef VMS @@ -194,9 +194,9 @@ openfiles() #ifdef MSDOS /* File doesn't exist in current directory; try in INIT directory. */ cp = getenv("INIT"); - if (filename == 0 && cp != 0) + if (filename == 0 && cp != NULL) { - filename = malloc(strlen(cp) + strlen(PFILE) + 2); + filename = xmalloc(strlen(cp) + strlen(PFILE) + 2); strcpy(filename, cp); cp = filename + strlen(filename); *cp++ = '/'; @@ -284,9 +284,9 @@ open_extra_files() #ifdef MSDOS /* File doesn't exist in current directory; try in INIT directory. */ cp = getenv("INIT"); - if (filename == 0 && cp != 0) + if (filename == 0 && cp != NULL) { - filename = malloc(strlen(cp) + strlen(PFILE1) + 2); + filename = xmalloc(strlen(cp) + strlen(PFILE1) + 2); strcpy(filename, cp); cp = filename + strlen(filename); *cp++ = '/'; @@ -373,7 +373,7 @@ int k; } } -#ifdef VMS +#if defined (VMS) & !defined (__VMS_POSIX) if (faction) delete(actfile); if (fattrs) @@ -390,5 +390,5 @@ int k; if (tmpdefsfile) unlink(tmpdefsfile); #endif /* MSDOS */ exit(k); -#endif /* not VMS */ +#endif /* not VMS, or __VMS_POSIX */ }