diff options
author | Ranjit Mathew <rmathew@hotmail.com> | 2003-03-10 19:39:18 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2003-03-10 19:39:18 +0000 |
commit | 630287af48fcf25759f9e96d0ef39db90b5fa3af (patch) | |
tree | fa4274affbe4493621a42186068b16c1747c9778 /gcc/java/jcf-io.c | |
parent | 5c2424217a35eee7fa8bf1e8456b2143af632e53 (diff) | |
download | gcc-630287af48fcf25759f9e96d0ef39db90b5fa3af.zip gcc-630287af48fcf25759f9e96d0ef39db90b5fa3af.tar.gz gcc-630287af48fcf25759f9e96d0ef39db90b5fa3af.tar.bz2 |
jcf-io.c (caching_stat): Account for both DIR_SEPARATOR and DIR_SEPARATOR_2 for a target.
2003-03-10 Ranjit Mathew <rmathew@hotmail.com>
* jcf-io.c (caching_stat): Account for both DIR_SEPARATOR
and DIR_SEPARATOR_2 for a target.
Correct minor typos.
* jcf-write.c (make_class_file_name): Take both DIR_SEPARATOR
and DIR_SEPARATOR_2 for a target into account.
From-SVN: r64110
Diffstat (limited to 'gcc/java/jcf-io.c')
-rw-r--r-- | gcc/java/jcf-io.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c index 3b10f39..cb56c09 100644 --- a/gcc/java/jcf-io.c +++ b/gcc/java/jcf-io.c @@ -336,6 +336,7 @@ caching_stat (char *filename, struct stat *buf) { #if JCF_USE_SCANDIR char *sep; + char origsep; char *base; memoized_dirlist_entry *dent; void **slot; @@ -349,15 +350,20 @@ caching_stat (char *filename, struct stat *buf) /* Get the name of the directory. */ sep = strrchr (filename, DIR_SEPARATOR); +#ifdef DIR_SEPARATOR_2 + if (! sep) + sep = strrchr (filename, DIR_SEPARATOR_2); +#endif if (sep) { + origsep = *sep; *sep = '\0'; base = sep + 1; } else base = filename; - /* Obtain the entry for this directory form the hash table. */ + /* Obtain the entry for this directory from the hash table. */ slot = htab_find_slot (memoized_dirlists, filename, INSERT); if (!*slot) { @@ -380,7 +386,7 @@ caching_stat (char *filename, struct stat *buf) /* Put the separator back. */ if (sep) - *sep = DIR_SEPARATOR; + *sep = origsep; /* If the file is not in the list, there is no need to stat it; it does not exist. */ |