This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: minor factory fix
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 14 Oct 2005 13:06:01 -0600
- Subject: [gcjx] Patch: FYI: minor factory fix
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
directory_class_factory::find_derived_file was not working properly when
the directory was "".
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* factory.cc (find_derived_file): Handle case where directory is
the empty string.
Index: factory.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/Attic/factory.cc,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 factory.cc
--- factory.cc 20 Sep 2005 17:04:12 -0000 1.1.2.4
+++ factory.cc 14 Oct 2005 19:11:41 -0000
@@ -129,7 +129,10 @@
directory_class_factory::find_derived_file (const std::string &name)
{
assert (! is_source_only ());
- std::string file = directory + FILE_SEPARATOR + name;
+ std::string file = directory;
+ if (! file.empty ())
+ file += FILE_SEPARATOR;
+ file += name;
int fd = open (file.c_str (), O_RDONLY | O_BINARY);
if (fd < 0)
return NULL;