PATH_SEPARATOR not platform independent

Tom Tromey tromey@redhat.com
Mon Oct 9 22:31:00 GMT 2006


>>>>> "Marco" == Marco Trudel <mtrudel@gmx.ch> writes:

Marco> Ok. How to do that? _Jv_platform_path_separator is jchar but I need
Marco> char*. How to convert that correctly?
Try this.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
	* prims.cc (_Jv_PrependVersionedLibdir): Use
	_Jv_platform_path_separator.
Index: prims.cc
===================================================================
--- prims.cc	(revision 117258)
+++ prims.cc	(working copy)
@@ -1788,11 +1788,14 @@
 {
 // LD_LIBRARY_PATH is not prefixed with
 // GCJ_VERSIONED_LIBDIR.
- jsize total = (sizeof (GCJ_VERSIONED_LIBDIR) - 1)
- + (sizeof (PATH_SEPARATOR) - 1) + strlen (libpath) + 1;
+	 char path_sep[2];
+	 path_sep[0] = (char) _Jv_platform_path_separator;
+	 path_sep[1] = '0円';
+ jsize total = ((sizeof (GCJ_VERSIONED_LIBDIR) - 1)
+			 + 1 /* path separator */ + strlen (libpath) + 1);
 retval = (char*) _Jv_Malloc (total);
 strcpy (retval, GCJ_VERSIONED_LIBDIR);
- strcat (retval, PATH_SEPARATOR);
+ strcat (retval, path_sep);
 strcat (retval, libpath);
 }
 }


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /