Akeroyd, FA (Freddie) wrote:
Hi,

You should find out how the problematic path is built (see kernel/MethodInfo.st as well as examples/Publish.st). You can try

(AbstractNamespace >> #superspace) methodSourceCode fileName

to see if the bad path is generated by GNU Smalltalk itself, or rather


This gave

'C:\msys\1.0\home\faa59\Smalltalk_gnu\smalltalk-2.3.5/C:/msys/1.0/home/f
aa59/Smalltalk_gnu/smalltalk-2.3.5/kernel/AbstNamespc.st'

I applied the enclosed patch to File.st

The patch is fine, I'm applying it.

The bug you found in fullNameFor: is also real; to fix it, you can simply use "old, self pathSeparatorString, each" instead of "Directory append: each to: old".

The real problem however is in _gst_get_full_file_name, which also needs to know about Windows paths. Something like this should do (in libgst/sysdep.c):

char *
_gst_get_full_file_name (const char *fileName)
{
  char *fullFileName;
  static char *fullPath = NULL;

  /* Absolute paths don't need to change */
  if (fileName[0] == '/')
    return (xstrdup (fileName));
#if defined WIN32 && !defined __CYGWIN__
  if (fileName[0] == '\\' || (fileName[0] != '\0' && fileName[1] == ':'))
    return (xstrdup (fileName));
#endif

  /* Only need to do this once, then cache the result */
  if (fullPath == NULL)
    fullPath = _gst_get_cur_dir_name ();

#if !defined WIN32 || defined __CYGWIN__
  asprintf (&fullFileName, "%s/%s", fullPath, fileName);
#else
  asprintf (&fullFileName, "%s\\%s", fullPath, fileName);
#endif

  return (fullFileName);
}

For 3.0 I will use the Win32 API function GetFullPathName (this piece of code changed completely), but for now this should be enough.

Paolo


_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to