Commit 71efde97 by Richard Kenner

(do_include): For VMS...

(do_include): For VMS, don't attempt to treat `#include X' as
`#include <X.h>' unless `X' has already been macro expanded.
(main): For VMS, do a better job of picking out the base name from
argv[0]'s absolute name.

From-SVN: r8820
parent 3a887df4
...@@ -1149,16 +1149,19 @@ main (argc, argv) ...@@ -1149,16 +1149,19 @@ main (argc, argv)
#ifdef VMS #ifdef VMS
{ {
/* Remove directories from PROGNAME. */ /* Remove directories from PROGNAME. */
char *s; char *s = progname;
progname = savestring (argv[0]); if ((p = rindex (s, ':')) != 0) s = p + 1; /* skip device */
if ((p = rindex (s, ']')) != 0) s = p + 1; /* skip directory */
if (!(s = rindex (progname, ']'))) if ((p = rindex (s, '>')) != 0) s = p + 1; /* alternate (int'n'l) dir */
s = rindex (progname, ':'); s = progname = savestring (s);
if (s) if ((p = rindex (s, ';')) != 0) *p = '\0'; /* strip version number */
strcpy (progname, s+1); if ((p = rindex (s, '.')) != 0 /* strip type iff ".exe" */
if (s = rindex (progname, '.')) && (p[1] == 'e' || p[1] == 'E')
*s = '\0'; && (p[2] == 'x' || p[2] == 'X')
&& (p[3] == 'e' || p[3] == 'E')
&& !p[4])
*p = '\0';
} }
#endif #endif
...@@ -4178,8 +4181,9 @@ get_filename: ...@@ -4178,8 +4181,9 @@ get_filename:
* Support '#include xyz' like VAX-C to allow for easy use of all the * Support '#include xyz' like VAX-C to allow for easy use of all the
* decwindow include files. It defaults to '#include <xyz.h>' (so the * decwindow include files. It defaults to '#include <xyz.h>' (so the
* code from case '<' is repeated here) and generates a warning. * code from case '<' is repeated here) and generates a warning.
* (Note: macro expansion of `xyz' takes precedence.)
*/ */
if (isalpha(*(--fbeg))) { if (retried && isalpha(*(--fbeg))) {
fend = fbeg; fend = fbeg;
while (fend != limit && (!isspace(*fend))) fend++; while (fend != limit && (!isspace(*fend))) fend++;
warning ("VAX-C-style include specification found, use '#include <filename.h>' !"); warning ("VAX-C-style include specification found, use '#include <filename.h>' !");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment