Commit 7cc322e3 by Richard Kenner

(main): Use DIR_SEPARATOR if defined.

Use "Include" environment variable instead of CPATH for winnt.

From-SVN: r8183
parent eb910b5a
...@@ -1136,7 +1136,12 @@ main (argc, argv) ...@@ -1136,7 +1136,12 @@ main (argc, argv)
#endif #endif
p = argv[0] + strlen (argv[0]); p = argv[0] + strlen (argv[0]);
while (p != argv[0] && p[-1] != '/') --p; while (p != argv[0] && p[-1] != '/'
#ifdef DIR_SEPARATOR
&& p[-1] != DIR_SEPARATOR
#endif
)
--p;
progname = p; progname = p;
#ifdef VMS #ifdef VMS
...@@ -1627,7 +1632,11 @@ main (argc, argv) ...@@ -1627,7 +1632,11 @@ main (argc, argv)
/* Some people say that CPATH should replace the standard include dirs, /* Some people say that CPATH should replace the standard include dirs,
but that seems pointless: it comes before them, so it overrides them but that seems pointless: it comes before them, so it overrides them
anyway. */ anyway. */
#ifdef WINNT
p = (char *) getenv ("Include");
#else
p = (char *) getenv ("CPATH"); p = (char *) getenv ("CPATH");
#endif
if (p != 0 && ! no_standard_includes) if (p != 0 && ! no_standard_includes)
path_include (p); path_include (p);
...@@ -1979,7 +1988,11 @@ main (argc, argv) ...@@ -1979,7 +1988,11 @@ main (argc, argv)
int len; int len;
/* Discard all directory prefixes from filename. */ /* Discard all directory prefixes from filename. */
if ((q = rindex (in_fname, '/')) != NULL) if ((q = rindex (in_fname, '/')) != NULL
#ifdef DIR_SEPARATOR
&& (q = rindex (in_fname, DIR_SEPARATOR)) != NULL
#endif
)
++q; ++q;
else else
q = in_fname; q = in_fname;
......
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