[Top][All Lists]

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

[PATCH] file-name.c and MinGW paths.

From: John McCabe-Dansted
Subject: [PATCH] file-name.c and MinGW paths.
Date: Sat, 17 Feb 2007 21:36:20 +0900

MinGW allows both \ and / as separators in paths.

What do you think of the approach of the attached patch to file-name.c?

Since pspp and psppire do not really call any exe's, the patch simply
changes file-name.c so it treats both \ and / as separators.

When it canonicalizes  the path it converts all \'s to the posixish
/'s. It should really also prefix all the paths with "A:" or, "C:" or
whatever too.

Another question: On windows, we don't know at compile time where the
program will be installed.
I suggest
1) that I write a relocate function that takes a path, strips the
compile time prefix, adds a runtime prefix and returns the result.
2) I write a static wrapper around the function that returns a string
that does not need to be freed.
3) I replace every occurance of
    PKGDATADIR "...."
    PKGDATADIR_R ("....")
where PKGDATADIR_R is a macro that, on MinGW, calls the static
wrapper, and otherwise just evaluates to
   PKGDATADIR "...."

John C. McCabe-Dansted
PhD Student
University of Western Australia

Attachment: file-name.c.patch
Description: Binary data

reply via email to

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