Patch: FYI: prims.cc fixlet
Marco Trudel
mtrudel@gmx.ch
Tue Oct 10 21:21:00 GMT 2006
Tom Tromey wrote:
> I'm checking this in on the trunk.
>
> This came up on the main list; it is just a small bit of unportable
> code in prims.cc.
>
> Tom
>
> Index: ChangeLog
> from Tom Tromey <tromey@redhat.com>
> * prims.cc (_Jv_PrependVersionedLibdir): Use
> _Jv_platform_path_separator.
>
> Index: prims.cc
> ===================================================================
> --- prims.cc (revision 117605)
> +++ 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);
> }
> }
Thanks! While you're add it, can you remove the comment
FIXME: does this work properly on Windows?
in gnu/classpath/natSystemProperties.cc? Because yes, now
java.library.path works on win32. I closed the bugreport.
Marco
More information about the Java-patches
mailing list