Am Samstag, 17. November 2007 11:39 schrieb Christian Stimming:
> "On windows, lookup prefix instead of only bindir.",
>
> Deswegen ist also mein Vorschlag, dass PathManager_AddRelPath sich auf
> Windows genauso verhalten möge wie auf Linux (dokumentiert war ein
> gewollter Unterschied zumindest nicht), und untenstehendes Patch erreicht
> genau das.

Alternativ könnte man anstelle eines entweder-oder auch das Verhalten von 
glib's g-win32-get-package-installation-directory kopieren,  
http://library.gnome.org/devel/glib/unstable/glib-Windows-Compatibility-Functions.html#g-win32-get-package-installation-directory
nämlich eine Fallunterscheidung, ob das Directory von GetModuleFileName() denn 
auf "bin" oder "lib" endet. Wenn ja, wird dieses Suffix noch rausgeworden. 
Wenn nein, wird das Directory direkt benutzt.

Besser?

Christian

>
> git-svn-id:
> https://devel.aqbanking.de/svn/gwenhywfar/branches/[EMAIL PROTECTED]
> 70169cfe-8b10-0410-8925-dcb4b91034d8
> ---
>  src/base/pathmanager.c |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/src/base/pathmanager.c b/src/base/pathmanager.c
> index 1b9bab5..9c6fc02 100644
> --- a/src/base/pathmanager.c
> +++ b/src/base/pathmanager.c
> @@ -227,6 +227,7 @@ int GWEN_PathManager_AddRelPath(const char *callingLib,
>      char *p;
>      GWEN_BUFFER *buf;
>
> +    /* Get the absolute path to the executable, including its name */
>      rv=GetModuleFileName(NULL, cwd, sizeof(cwd)-1);
>      if (rv==0) {
>        DBG_ERROR(GWEN_LOGDOMAIN,
> @@ -235,10 +236,21 @@ int GWEN_PathManager_AddRelPath(const char
> *callingLib, return GWEN_ERROR_IO;
>      }
>
> +    /* Find the last DIRSEP and set it to NULL so that we now have the
> +       bindir. */
>      p=strrchr(cwd, '\\');
>      if (p) {
>        *p=0;
>      }
> +
> +    /* Find again the last DIRSEP; set it to NULL so that we now have
> +       the prefix. */
> +    p=strrchr(cwd, '\\');
> +    if (p) {
> +      *p=0;
> +    }
> +
> +    /* And append the given subdirectory to that prefix. */
>      buf=GWEN_Buffer_new(0, 256, 0, 1);
>      GWEN_Buffer_AppendString(buf, cwd);
>      if (*pathValue!=DIRSEP_C)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Aqbanking-devel mailing list
Aqbanking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/aqbanking-devel

Reply via email to