aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-09-30 17:30:07 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-09-30 17:30:07 -0400
commit7cc322e36f790da11c19860c96f2166ee4ce9e3e (patch)
treec5b1dd3b8fc287c8b7890fe21651277f5e6f2dd0
parenteb910b5a56c7305decd563a2d737ac88b4e55492 (diff)
downloadgcc-7cc322e36f790da11c19860c96f2166ee4ce9e3e.zip
gcc-7cc322e36f790da11c19860c96f2166ee4ce9e3e.tar.gz
gcc-7cc322e36f790da11c19860c96f2166ee4ce9e3e.tar.bz2
(main): Use DIR_SEPARATOR if defined.
Use "Include" environment variable instead of CPATH for winnt. From-SVN: r8183
-rw-r--r--gcc/cccp.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index d34d8ed..b434300 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -1136,7 +1136,12 @@ main (argc, argv)
#endif
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;
#ifdef VMS
@@ -1627,7 +1632,11 @@ main (argc, argv)
/* Some people say that CPATH should replace the standard include dirs,
but that seems pointless: it comes before them, so it overrides them
anyway. */
+#ifdef WINNT
+ p = (char *) getenv ("Include");
+#else
p = (char *) getenv ("CPATH");
+#endif
if (p != 0 && ! no_standard_includes)
path_include (p);
@@ -1979,7 +1988,11 @@ main (argc, argv)
int len;
/* 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;
else
q = in_fname;