[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Building GNU Smalltalk-2.3.5 with MinGW

From: Paolo Bonzini
Subject: Re: [Help-smalltalk] Building GNU Smalltalk-2.3.5 with MinGW
Date: Tue, 19 Jun 2007 14:22:05 +0200
User-agent: Thunderbird (Macintosh/20070604)

Akeroyd, FA (Freddie) wrote:

You should find out how the problematic path is built (see kernel/ as well as examples/ You can try

(AbstractNamespace >> #superspace) methodSourceCode fileName

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

This gave


I applied the enclosed patch to

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));

  /* 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);
  asprintf (&fullFileName, "%s\\%s", fullPath, fileName);

  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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]