This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gcjx] Patch: FYI: minor factory fix


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]